Skip to content

refactor: Bumping up to rust v1.90#5112

Merged
baszalmstra merged 18 commits intoprefix-dev:mainfrom
prady0t:bump-to-1.90
Dec 16, 2025
Merged

refactor: Bumping up to rust v1.90#5112
baszalmstra merged 18 commits intoprefix-dev:mainfrom
prady0t:bump-to-1.90

Conversation

@prady0t
Copy link
Contributor

@prady0t prady0t commented Dec 10, 2025

Fixes #5109

prady0t and others added 2 commits December 11, 2025 02:03
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
@prady0t prady0t changed the title Bumping up to rust v1.90 refactor: Bumping up to rust v1.90 Dec 10, 2025
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
@prady0t prady0t marked this pull request as draft December 10, 2025 21:16
prady0t and others added 8 commits December 11, 2025 16:30
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
environment.name().fancy_display(),
)
.unwrap();
.into_diagnostic()?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using into_diagnostic() here and everywhere else in this file as unwrap() makes cargo clippy unhappy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of that we should use expect

})));
}
if let Ok(url) = url::Url::parse(value)
&& let Some(archive) = ArchiveIdentifier::try_from_url(&url)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another syntactic sugar that Clippy wants. There are a bunch of other places where I've refactored this.

Comment on lines 420 to 421
#[allow(dead_code)]
pub struct ParseExposedKeyError {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clippy finds this unused.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to delete it if it's truly unused

@prady0t prady0t marked this pull request as ready for review December 11, 2025 16:35
@prady0t
Copy link
Contributor Author

prady0t commented Dec 11, 2025

That one test failure looks like a fluke.

@baszalmstra this is ready for review.

Copy link
Contributor

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to also add the minimum supported rust version to the workspace cargo.toml. We use syntax now that is not supported by older versions. (if-let chains)

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Comment on lines +134 to +139
.unwrap_or_else(|_| {
panic!(
"Cannot install the {} environment",
environment.name().fancy_display()
)
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used unwrap_or_else here as we can print a helpful error message, I've used expect("") in rest of the cases.

license = "BSD-3-Clause"
readme = "README.md"
repository = "https://github.com/prefix-dev/pixi"
rust-version = "1.90"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping up to 1.90 as MSRV.

Copy link
Contributor

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add at least some reason to the expects instead of an empty string.

Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Comment on lines -382 to -396
#[derive(Debug, Error, Diagnostic)]
#[allow(dead_code)]
#[error("an error occurred while parsing the manifest")]
pub struct MultiTomlError {
#[related]
pub errors: Vec<TomlError>,
}

impl From<DeserError> for MultiTomlError {
fn from(value: DeserError) -> Self {
Self {
errors: value.errors.into_iter().map(Into::into).collect(),
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed since never used.

env,
)
.unwrap_or_else(|_| panic!("Cannot install the following environments: {}", env));
.expect("failed to write into message buffer");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's highly unlikely we would ever get this error but had to be added since cargo-clipy is set to treat warnings as errors.

Comment on lines -414 to -422
/// Represents an error that occurs when parsing an binary exposed name.
///
/// This error is returned when a string fails to be parsed as an environment
/// name.
#[derive(Debug, Clone, Error, Diagnostic, PartialEq)]
#[error("pixi is not allowed as exposed name in the map")]
#[allow(dead_code)]
pub struct ParseExposedKeyError {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed since never used.

@baszalmstra baszalmstra enabled auto-merge (squash) December 16, 2025 08:30
@baszalmstra
Copy link
Contributor

Thanks @prady0t !

@baszalmstra baszalmstra merged commit 19d4257 into prefix-dev:main Dec 16, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump to rust v1.90

3 participants