From 67e5c612b093b2e600769da6d70a7d2d0f0c1d6a Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 18 Jun 2024 09:50:32 -0500 Subject: [PATCH] Use `&impl AsRef` instead of type parameter --- 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 a362c99d0d5..7ba89669e9e 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 f1e3bf599e9..407f3770e45 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 66cccd28a1d..627cc70ad4f 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) {