Skip to content

Commit 4202e7f

Browse files
committed
Fix test lints
1 parent e0a0d40 commit 4202e7f

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/vm/src/compatibility.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ pub struct LogAccess<'a>(RefMut<'a, Vec<String>>);
110110

111111
impl<'a> LogAccess<'a> {
112112
/// Adds a message to the logs
113-
pub fn add(&mut self, msg: String) {
114-
self.0.push(msg);
113+
pub fn add(&mut self, msg: impl Into<String>) {
114+
self.0.push(msg.into());
115115
}
116116
}
117117

@@ -409,18 +409,16 @@ mod tests {
409409
fn logs_works() {
410410
let mut logs = Logs::new();
411411

412-
if let Some(mut logs) = logs.open() {
413-
logs.add(format!("a test"));
414-
}
412+
logs.add(|| "a test".to_string());
415413

416414
if let Some(mut logs) = logs.open() {
417-
logs.add(format!("second test"));
418-
logs.add(format!("third test"));
415+
logs.add("second test");
416+
logs.add("third test");
419417
}
420418

421419
let mut logs_b = logs.clone();
422420
if let Some(mut logs) = logs_b.open() {
423-
logs.add(format!("added in b"));
421+
logs.add("added in b");
424422
}
425423

426424
let mut iter = logs.into_iter();

0 commit comments

Comments
 (0)