diff --git a/crates/huak_cli/src/cmd/mod.rs b/crates/huak_cli/src/cmd/mod.rs index 7bfaa103..4bb1ab96 100644 --- a/crates/huak_cli/src/cmd/mod.rs +++ b/crates/huak_cli/src/cmd/mod.rs @@ -61,7 +61,7 @@ fn make_venv_command( cmd: &mut Command, venv: &PythonEnvironment, ) -> HuakResult<()> { - let mut paths = env_path_values().unwrap_or(Vec::new()); + let mut paths = env_path_values().unwrap_or_default(); paths.insert(0, venv.executables_dir_path().clone()); cmd.env( diff --git a/crates/huak_ops/src/metadata.rs b/crates/huak_ops/src/metadata.rs index 87fc9dfd..318fa67e 100644 --- a/crates/huak_ops/src/metadata.rs +++ b/crates/huak_ops/src/metadata.rs @@ -237,7 +237,7 @@ impl Metadata { .optional_dependencies .get_or_insert_with(IndexMap::new) .entry(group.to_string()) - .or_insert_with(Vec::new) + .or_default() .push(dependency.requirement().to_owned()); } @@ -437,7 +437,7 @@ dev = [ let local_metadata = LocalMetadata::new(path).unwrap(); assert_eq!( - local_metadata.metadata.dependencies().unwrap().deref(), + local_metadata.metadata.dependencies().unwrap(), vec![Requirement::from_str("click==8.1.3").unwrap()] ); } diff --git a/crates/huak_ops/src/python_environment.rs b/crates/huak_ops/src/python_environment.rs index 4336e2f6..e4880e83 100644 --- a/crates/huak_ops/src/python_environment.rs +++ b/crates/huak_ops/src/python_environment.rs @@ -484,8 +484,7 @@ pub fn default_venv_name() -> &'static str { /// Get an `Iterator` over available Python `Interpreter` paths parsed from the `PATH` /// environment variable (inspired by brettcannon/python-launcher). pub fn python_paths() -> impl Iterator, PathBuf)> { - let paths = - fs::flatten_directories(env_path_values().unwrap_or(Vec::new())); + let paths = fs::flatten_directories(env_path_values().unwrap_or_default()); python_interpreters_in_paths(paths) }