diff --git a/dump/src/writer.rs b/dump/src/writer.rs index b49da974b..639463bab 100644 --- a/dump/src/writer.rs +++ b/dump/src/writer.rs @@ -245,7 +245,7 @@ pub(crate) mod test { let name = entry.file_name().into_string().unwrap(); let file_type = entry.file_type().unwrap(); - let is_dir = file_type.is_dir().then_some("/").unwrap_or(""); + let is_dir = if file_type.is_dir() { "/" } else { "" }; assert!(!file_type.is_symlink()); writeln!(ret, "{ident} {name}{is_dir}").unwrap(); diff --git a/index-scheduler/src/snapshot.rs b/index-scheduler/src/snapshot.rs index 40a43ffd8..b065301b0 100644 --- a/index-scheduler/src/snapshot.rs +++ b/index-scheduler/src/snapshot.rs @@ -196,7 +196,7 @@ fn snapshot_status(rtxn: &RoTxn, db: Database, RoaringBitma let iter = db.iter(rtxn).unwrap(); for next in iter { let (status, task_ids) = next.unwrap(); - write!(snap, "{status} {}\n", snapshot_bitmap(&task_ids)).unwrap(); + writeln!(snap, "{status} {}", snapshot_bitmap(&task_ids)).unwrap(); } snap } @@ -207,7 +207,7 @@ fn snapshot_kind(rtxn: &RoTxn, db: Database, RoaringBitmapCod for next in iter { let (kind, task_ids) = next.unwrap(); let kind = serde_json::to_string(&kind).unwrap(); - write!(snap, "{kind} {}\n", snapshot_bitmap(&task_ids)).unwrap(); + writeln!(snap, "{kind} {}", snapshot_bitmap(&task_ids)).unwrap(); } snap } @@ -217,7 +217,7 @@ fn snapshot_index_tasks(rtxn: &RoTxn, db: Database) -> let iter = db.iter(rtxn).unwrap(); for next in iter { let (index, task_ids) = next.unwrap(); - write!(snap, "{index} {}\n", snapshot_bitmap(&task_ids)).unwrap(); + writeln!(snap, "{index} {}", snapshot_bitmap(&task_ids)).unwrap(); } snap }