Skip to content

Commit

Permalink
Fix clippy/compile warnings
Browse files Browse the repository at this point in the history
Presumably these came with the new version of the rust compiler that
was recently released. The compile warning fix suggested by the
compiler/clippy was incorrect as the field in the `Response::Real`
variant is (kinda) used. Adding a name to the match clause seems
to kill the warning. The remaining fixes are exactly what clippy
suggested.
  • Loading branch information
staktrace committed Mar 29, 2024
1 parent 45778f1 commit 4ae21f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum Response<'a> {
impl Response<'_> {
fn has_header(&self, name: &str) -> bool {
match self {
Response::Real(response, _) => response.headers().contains_key(name),
Response::Real(response, _permit) => response.headers().contains_key(name),
#[cfg(test)]
Response::Mock(_) => false,
}
Expand Down
2 changes: 1 addition & 1 deletion src/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ pub mod spanned {
thread_local! {
/// Hack to work around `toml::Spanned` failing to be deserialized when
/// used with the `toml::Value` deserializer.
pub(super) static DISABLE_SPANNED_DESERIALIZATION: Cell<bool> = Cell::new(false);
pub(super) static DISABLE_SPANNED_DESERIALIZATION: Cell<bool> = const { Cell::new(false) };
}

/// A spanned value, indicating the range at which it is defined in the source.
Expand Down
1 change: 1 addition & 0 deletions src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2828,6 +2828,7 @@ fn create_unpack_lock(unpack_dir: &Path) -> Result<(), io::Error> {
// which may have been extracted from the package.
let mut ok = OpenOptions::new()
.create(true)
.truncate(true)
.read(true)
.write(true)
.open(lockfile)?;
Expand Down

0 comments on commit 4ae21f6

Please sign in to comment.