comparison rust/hg-core/examples/nodemap/main.rs @ 49920:0d301f4180f5

rust-clippy: use `write_all` since we're not expecting a partial write Clippy caught this. This is a good lint in general, but here this was not really a bug in this example code.
author Rapha?l Gom?s <rgomes@octobus.net>
date Mon, 09 Jan 2023 18:15:29 +0100
parents 58074252db3c
children 4c5f6e95df84
comparison
equal deleted inserted replaced
49919:bd42bd6eae45 49920:0d301f4180f5
38 for rev in 0..index.len() { 38 for rev in 0..index.len() {
39 let rev = rev as Revision; 39 let rev = rev as Revision;
40 nm.insert(index, index.node(rev).unwrap(), rev).unwrap(); 40 nm.insert(index, index.node(rev).unwrap(), rev).unwrap();
41 } 41 }
42 eprintln!("Nodemap constructed in RAM in {:?}", start.elapsed()); 42 eprintln!("Nodemap constructed in RAM in {:?}", start.elapsed());
43 file.write(&nm.into_readonly_and_added_bytes().1)?; 43 file.write_all(&nm.into_readonly_and_added_bytes().1)?;
44 eprintln!("Nodemap written to disk"); 44 eprintln!("Nodemap written to disk");
45 Ok(()) 45 Ok(())
46 } 46 }
47 47
48 fn query(index: &Index, nm: &NodeTree, prefix: &str) { 48 fn query(index: &Index, nm: &NodeTree, prefix: &str) {