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

Resolve clippy lints #755

Merged
merged 1 commit into from
Oct 8, 2023
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
2 changes: 1 addition & 1 deletion crates/huak_cli/src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions crates/huak_ops/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down Expand Up @@ -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()]
);
}
Expand Down
3 changes: 1 addition & 2 deletions crates/huak_ops/src/python_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = (Option<Version>, 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)
}
Expand Down
Loading