Skip to content

Commit

Permalink
Minor style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dnbln committed Dec 29, 2022
1 parent 7c8ee49 commit c63b8c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 37 deletions.
51 changes: 15 additions & 36 deletions src/cargo/core/compiler/fingerprint/dirty_reason.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use super::*;
use crate::core::Shell;

use std::fmt;
use std::fmt::Debug;

use super::*;
use crate::core::Shell;

#[derive(Clone, Debug)]
pub enum DirtyReason {
RustcChanged,
Expand Down Expand Up @@ -135,9 +135,7 @@ impl DirtyReason {
match self {
DirtyReason::RustcChanged => s.dirty_because(unit, "the toolchain changed"),
DirtyReason::FeaturesChanged { .. } => {
s.dirty_because(unit, "the list of features changed")?;

Ok(())
s.dirty_because(unit, "the list of features changed")
}
DirtyReason::TargetConfigurationChanged => {
s.dirty_because(unit, "the target configuration changed")
Expand All @@ -148,11 +146,7 @@ impl DirtyReason {
DirtyReason::ProfileConfigurationChanged => {
s.dirty_because(unit, "the profile configuration changed")
}
DirtyReason::RustflagsChanged { .. } => {
s.dirty_because(unit, "the rustflags changed")?;

Ok(())
}
DirtyReason::RustflagsChanged { .. } => s.dirty_because(unit, "the rustflags changed"),
DirtyReason::MetadataChanged => s.dirty_because(unit, "the metadata changed"),
DirtyReason::ConfigSettingsChanged => {
s.dirty_because(unit, "the config settings changed")
Expand All @@ -169,37 +163,25 @@ impl DirtyReason {
Ok(())
}
DirtyReason::PrecalculatedComponentsChanged { .. } => {
s.dirty_because(unit, "the precalculated components changed")?;

Ok(())
s.dirty_because(unit, "the precalculated components changed")
}
DirtyReason::DepInfoOutputChanged { .. } => {
s.dirty_because(unit, "the dependency info output changed")
}
DirtyReason::RerunIfChangedOutputFileChanged { .. } => {
s.dirty_because(unit, "rerun-if-changed output file path changed")?;

Ok(())
s.dirty_because(unit, "rerun-if-changed output file path changed")
}
DirtyReason::RerunIfChangedOutputPathsChanged { .. } => {
s.dirty_because(unit, "the rerun-if-changed instructions changed")?;

Ok(())
s.dirty_because(unit, "the rerun-if-changed instructions changed")
}
DirtyReason::EnvVarsChanged { .. } => {
s.dirty_because(unit, "the environment variables changed")?;

Ok(())
s.dirty_because(unit, "the environment variables changed")
}
DirtyReason::EnvVarChanged { name, .. } => {
s.dirty_because(unit, format_args!("the env variable {name} changed"))?;

Ok(())
s.dirty_because(unit, format_args!("the env variable {name} changed"))
}
DirtyReason::LocalFingerprintTypeChanged { .. } => {
s.dirty_because(unit, "the local fingerprint type changed")?;

Ok(())
s.dirty_because(unit, "the local fingerprint type changed")
}
DirtyReason::NumberOfDependenciesChanged { old, new } => s.dirty_because(
unit,
Expand Down Expand Up @@ -235,13 +217,10 @@ impl DirtyReason {
format_args!("the file `{}` has changed ({after})", file.display()),
)
}
StaleItem::ChangedEnv { var, .. } => {
s.dirty_because(
unit,
format_args!("the environment variable {var} changed"),
)?;
Ok(())
}
StaleItem::ChangedEnv { var, .. } => s.dirty_because(
unit,
format_args!("the environment variable {var} changed"),
),
},
FsStatus::StaleDependency {
name,
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/job.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::core::compiler::fingerprint::DirtyReason;
use std::fmt;
use std::mem;

use super::job_queue::JobState;
use crate::core::compiler::fingerprint::DirtyReason;
use crate::util::CargoResult;

pub struct Job {
Expand Down

0 comments on commit c63b8c0

Please sign in to comment.