Skip to content

Commit c417331

Browse files
underfinahabhgk
andauthored
fix: replace source should hash inner source (#60)
* fix: replace source should hash inner source * fix test --------- Co-authored-by: ahabhgk <[email protected]>
1 parent 81ee4e2 commit c417331

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/replace_source.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,9 @@ impl<T: Hash> Hash for ReplaceSource<T> {
547547
self.sort_replacement();
548548
"ReplaceSource".hash(state);
549549
for repl in self.replacements.lock().iter() {
550-
repl.hash(state)
550+
repl.hash(state);
551551
}
552+
self.inner.hash(state);
552553
}
553554
}
554555

@@ -962,7 +963,7 @@ return <div>{data.foo}</div>
962963
assert_eq!(source.map(&MapOptions::default()), None);
963964
let mut hasher = twox_hash::XxHash64::default();
964965
source.hash(&mut hasher);
965-
assert_eq!(format!("{:x}", hasher.finish()), "ab891b4c45dc95b4");
966+
assert_eq!(format!("{:x}", hasher.finish()), "e9877250d7449bc5");
966967
}
967968

968969
#[test]

src/source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ mod tests {
532532
RawSource::from("g").boxed().hash(&mut state);
533533
(&RawSource::from("h") as &dyn Source).hash(&mut state);
534534
ReplaceSource::new(RawSource::from("i").boxed()).hash(&mut state);
535-
assert_eq!(format!("{:x}", state.finish()), "940ec870b6ce313a");
535+
assert_eq!(format!("{:x}", state.finish()), "fb814b430ddd31e0");
536536
}
537537

538538
#[test]

0 commit comments

Comments
 (0)