From b3e3d899e5f72b1408f01b16c1bb8bc5f3982e2c Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 18 Jun 2024 11:54:07 -0400 Subject: [PATCH] Use `&impl AsRef` instead of type parameter (#4383) --- crates/uv-toolchain/src/lib.rs | 4 ++-- crates/uv/src/shell.rs | 2 +- crates/uv/tests/common/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/uv-toolchain/src/lib.rs b/crates/uv-toolchain/src/lib.rs index c6eb54268..e3f5a0d9c 100644 --- a/crates/uv-toolchain/src/lib.rs +++ b/crates/uv-toolchain/src/lib.rs @@ -289,9 +289,9 @@ mod tests { } /// Create child directories in a temporary directory. - fn new_search_path_directories>( + fn new_search_path_directories( &mut self, - names: &[P], + names: &[impl AsRef], ) -> Result> { let paths = names .iter() diff --git a/crates/uv/src/shell.rs b/crates/uv/src/shell.rs index f1e3bf599..407f3770e 100644 --- a/crates/uv/src/shell.rs +++ b/crates/uv/src/shell.rs @@ -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>(path: P) -> Option { + pub(crate) fn from_shell_path(path: impl AsRef) -> Option { parse_shell_from_path(path.as_ref()) } } diff --git a/crates/uv/tests/common/mod.rs b/crates/uv/tests/common/mod.rs index 66cccd28a..627cc70ad 100644 --- a/crates/uv/tests/common/mod.rs +++ b/crates/uv/tests/common/mod.rs @@ -582,7 +582,7 @@ pub fn site_packages_path(venv: &Path, python: &str) -> PathBuf { } } -pub fn venv_bin_path>(venv: &P) -> PathBuf { +pub fn venv_bin_path(venv: impl AsRef) -> PathBuf { if cfg!(unix) { venv.as_ref().join("bin") } else if cfg!(windows) {