Use &impl AsRef<Path> instead of type parameter (#4383)
This commit is contained in:
@@ -289,9 +289,9 @@ mod tests {
|
||||
}
|
||||
|
||||
/// Create child directories in a temporary directory.
|
||||
fn new_search_path_directories<P: AsRef<Path>>(
|
||||
fn new_search_path_directories(
|
||||
&mut self,
|
||||
names: &[P],
|
||||
names: &[impl AsRef<Path>],
|
||||
) -> Result<Vec<ChildPath>> {
|
||||
let paths = names
|
||||
.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("/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())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
venv.as_ref().join("bin")
|
||||
} else if cfg!(windows) {
|
||||
|
||||
Reference in New Issue
Block a user