Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use impl AsRef<Path> instead of type parameter #4383

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading