Skip to content

Commit

Permalink
Use &impl AsRef<Path> instead of type parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jun 18, 2024
1 parent 1ce2147 commit 67e5c61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/uv-toolchain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 67e5c61

Please sign in to comment.