mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-02 23:04:37 +00:00
Use &impl AsRef<Path>
instead of type parameter (#4383)
This commit is contained in:
parent
0b0a0472ad
commit
b3e3d899e5
3 changed files with 4 additions and 4 deletions
|
@ -289,9 +289,9 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create child directories in a temporary directory.
|
/// Create child directories in a temporary directory.
|
||||||
fn new_search_path_directories<P: AsRef<Path>>(
|
fn new_search_path_directories(
|
||||||
&mut self,
|
&mut self,
|
||||||
names: &[P],
|
names: &[impl AsRef<Path>],
|
||||||
) -> Result<Vec<ChildPath>> {
|
) -> Result<Vec<ChildPath>> {
|
||||||
let paths = names
|
let paths = names
|
||||||
.iter()
|
.iter()
|
||||||
|
|
|
@ -67,7 +67,7 @@ impl Shell {
|
||||||
/// assert_eq!(Shell::from_shell_path("/usr/bin/zsh"), Some(Shell::Zsh));
|
/// assert_eq!(Shell::from_shell_path("/usr/bin/zsh"), Some(Shell::Zsh));
|
||||||
/// assert_eq!(Shell::from_shell_path("/opt/my_custom_shell"), None);
|
/// assert_eq!(Shell::from_shell_path("/opt/my_custom_shell"), None);
|
||||||
/// ```
|
/// ```
|
||||||
pub(crate) fn from_shell_path<P: AsRef<Path>>(path: P) -> Option<Shell> {
|
pub(crate) fn from_shell_path(path: impl AsRef<Path>) -> Option<Shell> {
|
||||||
parse_shell_from_path(path.as_ref())
|
parse_shell_from_path(path.as_ref())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -582,7 +582,7 @@ pub fn site_packages_path(venv: &Path, python: &str) -> PathBuf {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn venv_bin_path<P: AsRef<Path>>(venv: &P) -> PathBuf {
|
pub fn venv_bin_path(venv: impl AsRef<Path>) -> PathBuf {
|
||||||
if cfg!(unix) {
|
if cfg!(unix) {
|
||||||
venv.as_ref().join("bin")
|
venv.as_ref().join("bin")
|
||||||
} else if cfg!(windows) {
|
} else if cfg!(windows) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue