Skip to content

Commit fd7eacb

Browse files
committed
Rust assert should have a literal second argument
1 parent 12c539b commit fd7eacb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/backup.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,11 @@ mod tests {
475475
assert_eq!(stats.compressed_bytes, 8);
476476

477477
// Will vary depending on compressor and we don't want to be too brittle.
478-
assert!(stats.compressed_bytes <= 19, stats.compressed_bytes);
478+
assert!(
479+
stats.compressed_bytes <= 19,
480+
"too many compressed_bytes: {}",
481+
stats.compressed_bytes
482+
);
479483

480484
// Try to read back
481485
let (back, sizes) = block_dir.get(&addrs[0]).unwrap();

src/band.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ mod tests {
327327

328328
let e = Band::open(&af, &BandId::zero());
329329
let e_str = e.unwrap_err().to_string();
330-
assert!(e_str.contains("Band version \"0.8.8\" in"), e_str);
330+
assert!(
331+
e_str.contains("Band version \"0.8.8\" in"),
332+
"bad band version: {:#?}",
333+
e_str
334+
);
331335
}
332336
}

src/live_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ mod tests {
397397

398398
let repr = format!("{:?}", &result[6]);
399399
let re = Regex::new(r#"LiveEntry \{ apath: Apath\("/jam/apricot"\), kind: File, mtime: UnixTime \{ [^)]* \}, size: Some\(8\), symlink_target: None \}"#).unwrap();
400-
assert!(re.is_match(&repr), repr);
400+
assert!(re.is_match(&repr));
401401

402402
// TODO: Somehow get the stats out of the iterator.
403403
// assert_eq!(source_iter.stats.directories_visited, 4);

0 commit comments

Comments
 (0)