Skip to content

Commit

Permalink
feat: clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejager committed Jan 16, 2025
1 parent 5c3c0ae commit 1366055
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion crates/pixi-build/src/bin/pixi-build-python/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl PythonBuildBackend {
continue;
}

host_dependencies.insert(&pkg_name, &any);
host_dependencies.insert(pkg_name, &any);
}

requirements.build = extract_dependencies(channel_config, build_dependencies, variant)?;
Expand Down
4 changes: 2 additions & 2 deletions crates/pixi-build/src/build_types_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ impl BinarySpecExt for pbt::BinaryPackageSpecV1 {
.as_ref()
.map(|url| Arc::new(Channel::from_url(url.clone()))),
subdir: self.subdir.clone(),
md5: self.md5.as_ref().map(|m| m.0.clone()),
sha256: self.sha256.as_ref().map(|s| s.0.clone()),
md5: self.md5.as_ref().map(|m| m.0),
sha256: self.sha256.as_ref().map(|s| s.0),
namespace: None,
url: None,
}
Expand Down
12 changes: 6 additions & 6 deletions crates/pixi-build/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ fn project_model_v1(
}))
}

/// Negotiate the capabilities of the backend and initalize the backend.
async fn initalize<T: ProtocolFactory>(
/// Negotiate the capabilities of the backend and initialize the backend.
async fn initialize<T: ProtocolFactory>(
factory: T,
manifest_path: &Path,
) -> miette::Result<T::Protocol> {
// Negotiate the capabilities of the backend.
let capabilites = capabilities::<T>().await?;
let capabilities = capabilities::<T>().await?;
let channel_config = ChannelConfig::default_with_root_dir(
manifest_path
.parent()
Expand All @@ -155,7 +155,7 @@ async fn initalize<T: ProtocolFactory>(

// Check if the project model is required
// and if it is not present, return an error.
if capabilites.highest_supported_project_model.is_some() && project_model.is_none() {
if capabilities.highest_supported_project_model.is_some() && project_model.is_none() {
miette::bail!(
"Could not extract 'project_model' from: {}, while it is required",
manifest_path.display()
Expand Down Expand Up @@ -186,7 +186,7 @@ async fn get_conda_metadata<T: ProtocolFactory>(
.to_path_buf(),
);

let protocol = initalize(factory, manifest_path).await?;
let protocol = initialize(factory, manifest_path).await?;
let virtual_packages: Vec<_> = VirtualPackage::detect(&VirtualPackageOverrides::from_env())
.into_diagnostic()?
.into_iter()
Expand Down Expand Up @@ -233,7 +233,7 @@ async fn build<T: ProtocolFactory>(factory: T, manifest_path: &Path) -> miette::
.to_path_buf(),
);

let protocol = initalize(factory, manifest_path).await?;
let protocol = initialize(factory, manifest_path).await?;
let work_dir = TempDir::new_in(".")
.into_diagnostic()
.context("failed to create a temporary directory in the current directory")?;
Expand Down
4 changes: 2 additions & 2 deletions crates/pixi-build/src/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<'a> MatchspecExtractor<'a> {
for (name, spec) in dependencies.into_iter() {
let name = PackageName::from_str(name.as_str()).into_diagnostic()?;
// If we have a variant override, we should use that instead of the spec.
if can_be_used_as_variant(&spec) {
if can_be_used_as_variant(spec) {
if let Some(variant_value) = self
.variant
.as_ref()
Expand Down Expand Up @@ -105,7 +105,7 @@ impl<'a> MatchspecExtractor<'a> {
pbt::PackageSpecV1::Source(source_spec) => match source_spec {
pbt::SourcePackageSpecV1::Path(path) => {
let path =
resolve_path(&Path::new(&path.path), root_dir).ok_or_else(|| {
resolve_path(Path::new(&path.path), root_dir).ok_or_else(|| {
miette::miette!("failed to resolve home dir for: {}", path.path)
})?;
if self.ignore_self && path.as_path() == root_dir.as_path() {
Expand Down
38 changes: 19 additions & 19 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@ platforms = ["osx-arm64", "win-64", "linux-64", "osx-64"]

[tasks]
run-release = { cmd = "cargo run --release", inputs = [
"crates/**",
"Cargo.toml",
"Cargo.lock",
"crates/**",
"Cargo.toml",
"Cargo.lock",
], outputs = [
"target/debug/**",
"target/debug/**",
] }

build = { cmd = "cargo build", inputs = [
"crates/**",
"Cargo.toml",
"Cargo.lock",
"crates/**",
"Cargo.toml",
"Cargo.lock",
], outputs = [
"target/debug/**",
"target/debug/**",
] }
build-release = { cmd = "cargo build --release", inputs = [
"crates/**",
"Cargo.toml",
"Cargo.lock",
"crates/**",
"Cargo.toml",
"Cargo.lock",
], outputs = [
"target/release/**",
"target/release/**",
] }
run = { cmd = "cargo run", inputs = [
"crates/**",
"Cargo.toml",
"Cargo.lock",
"crates/**",
"Cargo.toml",
"Cargo.lock",
], outputs = [
"target/debug/**",
"target/debug/**",
] }


install-pixi-build-python = { cmd = "cargo install --path crates/pixi-build --bin pixi-build-python --locked" }
install-pixi-build-cmake = { cmd = "cargo install --path crates/pixi-build --bin pixi-build-cmake --locked" }
install-pixi-build-rattler-build = { cmd = "cargo install --path crates/pixi-build --bin pixi-build-rattler-build --locked" }
install-pixi-backends = { depends-on = [
"install-pixi-build-python",
"install-pixi-build-cmake",
"install-pixi-build-rattler-build"
"install-pixi-build-python",
"install-pixi-build-cmake",
"install-pixi-build-rattler-build",
] }

[dependencies]
Expand Down

0 comments on commit 1366055

Please sign in to comment.