mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-16 05:20:04 +00:00
Use the canonical ImplementationName
-> &str
implementation (#14337)
Motivated by some code duplication highlighted in https://github.com/astral-sh/uv/pull/14201, I noticed we weren't taking advantage of the existing implementation for casting to a str here. Unfortunately, we do need a special case for CPython still.
This commit is contained in:
parent
db14cc3005
commit
692667cbb0
2 changed files with 15 additions and 5 deletions
|
@ -362,11 +362,7 @@ impl ManagedPythonInstallation {
|
|||
/// If windowed is true, `pythonw.exe` is selected over `python.exe` on windows, with no changes
|
||||
/// on non-windows.
|
||||
pub fn executable(&self, windowed: bool) -> PathBuf {
|
||||
let implementation = match self.implementation() {
|
||||
ImplementationName::CPython => "python",
|
||||
ImplementationName::PyPy => "pypy",
|
||||
ImplementationName::GraalPy => "graalpy",
|
||||
};
|
||||
let implementation = self.implementation().executable_name();
|
||||
|
||||
let version = match self.implementation() {
|
||||
ImplementationName::CPython => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue