Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev committed Jun 11, 2024
1 parent 6ed4fd0 commit b589dd7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/uv/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ pub(crate) struct AddArgs {
pub(crate) struct RemoveArgs {
/// The names of the packages to remove (e.g., `flask`).
#[arg(required = true)]
pub(crate) requirements: Vec<String>,
pub(crate) requirements: Vec<PackageName>,

/// The Python interpreter into which packages should be installed.
///
Expand Down
3 changes: 1 addition & 2 deletions crates/uv/src/commands/project/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::printer::Printer;
/// Remove one or more packages from the project requirements.
#[allow(clippy::too_many_arguments)]
pub(crate) async fn remove(
requirements: Vec<String>,
requirements: Vec<PackageName>,
python: Option<String>,
preview: PreviewMode,
cache: &Cache,
Expand All @@ -29,7 +29,6 @@ pub(crate) async fn remove(

let mut pyproject = PyProjectTomlMut::from_toml(project.current_project().pyproject_toml())?;
for req in requirements {
let req = PackageName::new(req)?;
if pyproject.remove_dependency(&req)?.is_empty() {
anyhow::bail!(
"The dependency `{}` could not be found in `dependencies`",
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ impl AddSettings {
#[allow(clippy::struct_excessive_bools, dead_code)]
#[derive(Debug, Clone)]
pub(crate) struct RemoveSettings {
pub(crate) requirements: Vec<String>,
pub(crate) requirements: Vec<PackageName>,
pub(crate) python: Option<String>,
}

Expand Down

0 comments on commit b589dd7

Please sign in to comment.