Skip to content

Commit

Permalink
Auto merge of #9546 - ehuss:fingerprint-dead-code, r=Eh2406
Browse files Browse the repository at this point in the history
Remove some dead code.
  • Loading branch information
bors committed Jun 5, 2021
2 parents 1a8692d + cc683fd commit d3bc132
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions src/cargo/core/compiler/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,6 @@ impl LocalFingerprint {
}
}

#[derive(Debug)]
struct MtimeSlot(Mutex<Option<FileTime>>);

impl Fingerprint {
fn new() -> Fingerprint {
Fingerprint {
Expand Down Expand Up @@ -1153,37 +1150,6 @@ impl hash::Hash for Fingerprint {
}
}

impl hash::Hash for MtimeSlot {
fn hash<H: Hasher>(&self, h: &mut H) {
self.0.lock().unwrap().hash(h)
}
}

impl ser::Serialize for MtimeSlot {
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
where
S: ser::Serializer,
{
self.0
.lock()
.unwrap()
.map(|ft| (ft.unix_seconds(), ft.nanoseconds()))
.serialize(s)
}
}

impl<'de> de::Deserialize<'de> for MtimeSlot {
fn deserialize<D>(d: D) -> Result<MtimeSlot, D::Error>
where
D: de::Deserializer<'de>,
{
let kind: Option<(i64, u32)> = de::Deserialize::deserialize(d)?;
Ok(MtimeSlot(Mutex::new(
kind.map(|(s, n)| FileTime::from_unix_time(s, n)),
)))
}
}

impl DepFingerprint {
fn new(cx: &mut Context<'_, '_>, parent: &Unit, dep: &UnitDep) -> CargoResult<DepFingerprint> {
let fingerprint = calculate(cx, &dep.unit)?;
Expand Down

0 comments on commit d3bc132

Please sign in to comment.