diff --git a/Cargo.toml b/Cargo.toml index d5a44640..4c5fed70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,27 +11,27 @@ license = "MIT" edition = "2021" [dependencies] -bytemuck = { version = "1.14.0", features = ["derive", "extern_crate_alloc"] } +bytemuck = { version = "1.16.1", features = ["derive", "extern_crate_alloc"] } byteorder = "1.5.0" -heed = { version = "0.20.1", default-features = false } -log = "0.4.20" -memmap2 = "0.9.0" -ordered-float = "4.1.1" +heed = { version = "0.20.2", default-features = false } +log = "0.4.21" +memmap2 = "0.9.4" +ordered-float = "4.2.0" rand = { version = "0.8.5", features = ["alloc"] } -rayon = "1.8.0" -roaring = "0.10.2" -tempfile = "3.8.1" -thiserror = "1.0.50" +rayon = "1.10.0" +roaring = "0.10.5" +tempfile = "3.10.1" +thiserror = "1.0.61" [dev-dependencies] -anyhow = "1.0.75" +anyhow = "1.0.86" arbitrary = { version = "1.3.2", features = ["derive"] } -clap = { version = "4.4.10", features = ["derive"] } -env_logger = "0.10.1" -insta = "1.34.0" +clap = { version = "4.5.7", features = ["derive"] } +env_logger = "0.11.3" +insta = "1.39.0" instant-distance = "0.6.1" rand = { version = "0.8.5", features = ["std_rng"] } -tempfile = "3.8.1" +tempfile = "3.10.1" [features] default = [] diff --git a/src/node.rs b/src/node.rs index f4c67670..bb115c90 100644 --- a/src/node.rs +++ b/src/node.rs @@ -57,6 +57,7 @@ impl UnalignedF32Slice { /// Creates an unaligned slice of f32 wrapper from a slice of bytes. pub fn from_bytes(bytes: &[u8]) -> Result<&Self, SizeMismatch> { if bytes.len() % size_of::() == 0 { + // safety: `UnalignedF32Slice` is transparent Ok(unsafe { transmute(bytes) }) } else { Err(SizeMismatch) diff --git a/src/parallel.rs b/src/parallel.rs index 4868690f..d9170967 100644 --- a/src/parallel.rs +++ b/src/parallel.rs @@ -79,6 +79,7 @@ impl<'a, DE: BytesEncode<'a>> TmpNodes { /// Converts it into a readers to read the nodes. pub fn into_bytes_reader(self) -> Result { let file = self.file.into_inner().map_err(|iie| iie.into_error())?; + // safety: No one should move our files around let mmap = unsafe { Mmap::map(&file)? }; #[cfg(unix)] mmap.advise(memmap2::Advice::Sequential)?; @@ -224,6 +225,10 @@ impl<'t, D: Distance> ImmutableLeafs<'t, D> { Some(ptr) => *ptr, None => return Ok(None), }; + + // safety: + // - ptr: The pointer comes from LMDB. Since the database cannot be written to, it is still valid. + // - len: All the items share the same dimensions and are the same size let bytes = unsafe { slice::from_raw_parts(ptr, len) }; NodeCodec::bytes_decode(bytes).map_err(heed::Error::Decoding).map(|node| node.leaf()) } @@ -326,6 +331,9 @@ impl<'t, D: Distance> ImmutableTrees<'t, D> { None => return Ok(None), }; + // safety: + // - ptr: The pointer comes from LMDB. Since the database cannot be written to, it is still valid. + // - len: The len cannot change either let bytes = unsafe { slice::from_raw_parts(ptr, len) }; NodeCodec::bytes_decode(bytes).map_err(heed::Error::Decoding).map(Some) } diff --git a/src/tests/reader.rs b/src/tests/reader.rs index 41162d4d..84adec3a 100644 --- a/src/tests/reader.rs +++ b/src/tests/reader.rs @@ -34,7 +34,7 @@ fn open_unfinished_db() { let rtxn = handle.env.read_txn().unwrap(); let ret = Reader::::open(&rtxn, 0, handle.database).map(|_| ()).unwrap_err(); - insta::assert_display_snapshot!(ret, @"Metadata are missing on index 0, You must build your database before attempting to read it"); + insta::assert_snapshot!(ret, @"Metadata are missing on index 0, You must build your database before attempting to read it"); } #[test] @@ -50,7 +50,7 @@ fn open_db_with_wrong_dimension() { let rtxn = handle.env.read_txn().unwrap(); let reader = Reader::::open(&rtxn, 0, handle.database).unwrap(); let ret = reader.nns_by_vector(&rtxn, &[1.0, 2.0, 3.0], 5, None, None).unwrap_err(); - insta::assert_display_snapshot!(ret, @"Invalid vector dimensions. Got 3 but expected 2"); + insta::assert_snapshot!(ret, @"Invalid vector dimensions. Got 3 but expected 2"); } #[test] @@ -89,7 +89,7 @@ fn search_in_db_with_a_single_vector() { let reader = Reader::::open(&rtxn, 0, handle.database).unwrap(); let ret = reader.nns_by_item(&rtxn, 0, 1, None, None).unwrap(); - insta::assert_display_snapshot!(NnsRes(ret), @r###" + insta::assert_snapshot!(NnsRes(ret), @r###" id(0): distance(0) "###); } @@ -113,14 +113,14 @@ fn two_dimension_on_a_line() { // if we can't look into enough nodes we find some random points let ret = reader.nns_by_item(&rtxn, 0, 5, NonZeroUsize::new(1), None).unwrap(); - insta::assert_display_snapshot!(NnsRes(ret), @r###" + insta::assert_snapshot!(NnsRes(ret), @r###" id(48): distance(48) id(92): distance(92) "###); // if we can look into all the node there is no inifinite loop and it works let ret = reader.nns_by_item(&rtxn, 0, 5, NonZeroUsize::new(usize::MAX), None).unwrap(); - insta::assert_display_snapshot!(NnsRes(ret), @r###" + insta::assert_snapshot!(NnsRes(ret), @r###" id(0): distance(0) id(1): distance(1) id(2): distance(2) @@ -129,7 +129,7 @@ fn two_dimension_on_a_line() { "###); let ret = reader.nns_by_item(&rtxn, 0, 5, None, None).unwrap(); - insta::assert_display_snapshot!(NnsRes(ret), @r###" + insta::assert_snapshot!(NnsRes(ret), @r###" id(1): distance(1) id(2): distance(2) id(3): distance(3) @@ -160,7 +160,7 @@ fn two_dimension_on_a_column() { let reader = Reader::::open(&rtxn, 0, handle.database).unwrap(); let ret = reader.nns_by_item(&rtxn, 0, 5, None, None).unwrap(); - insta::assert_display_snapshot!(NnsRes(ret), @r###" + insta::assert_snapshot!(NnsRes(ret), @r###" id(1): distance(1) id(2): distance(2) id(3): distance(3) @@ -208,14 +208,14 @@ fn filtering() { let reader = Reader::::open(&rtxn, 0, handle.database).unwrap(); let ret = reader.nns_by_item(&rtxn, 0, 5, None, Some(&RoaringBitmap::from_iter(0..2))).unwrap(); - insta::assert_display_snapshot!(NnsRes(ret), @r###" + insta::assert_snapshot!(NnsRes(ret), @r###" id(0): distance(0) id(1): distance(1) "###); let ret = reader.nns_by_item(&rtxn, 0, 5, None, Some(&RoaringBitmap::from_iter(98..1000))).unwrap(); - insta::assert_display_snapshot!(NnsRes(ret), @r###" + insta::assert_snapshot!(NnsRes(ret), @r###" id(98): distance(98) id(99): distance(99) "###); diff --git a/src/tests/writer.rs b/src/tests/writer.rs index 872adc2d..d75e2e9e 100644 --- a/src/tests/writer.rs +++ b/src/tests/writer.rs @@ -46,7 +46,7 @@ fn use_u32_max_minus_one_for_a_vec() { writer.build(&mut wtxn, &mut rng(), Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 4294967294: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) @@ -65,7 +65,7 @@ fn use_u32_max_for_a_vec() { writer.build(&mut wtxn, &mut rng(), Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 4294967295: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) @@ -84,7 +84,7 @@ fn write_one_vector() { writer.build(&mut wtxn, &mut rng(), None).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) @@ -103,7 +103,7 @@ fn write_one_vector_in_one_tree() { writer.build(&mut wtxn, &mut rng(), Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) @@ -122,7 +122,7 @@ fn write_one_vector_in_multiple_trees() { writer.build(&mut wtxn, &mut rng(), Some(10)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) @@ -145,7 +145,7 @@ fn write_vectors_until_there_is_a_descendants() { writer.build(&mut wtxn, &mut rng(), Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000] }) @@ -170,7 +170,7 @@ fn write_vectors_until_there_is_a_split() { writer.build(&mut wtxn, &mut rng(), Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000] }) @@ -196,7 +196,7 @@ fn write_and_update_lot_of_random_points() { writer.build(&mut wtxn, &mut rng, Some(10)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle); + insta::assert_snapshot!(handle); let mut wtxn = handle.env.write_txn().unwrap(); let writer = Writer::new(handle.database, 0, 30); @@ -207,7 +207,7 @@ fn write_and_update_lot_of_random_points() { writer.build(&mut wtxn, &mut rng, Some(10)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle); + insta::assert_snapshot!(handle); } #[test] @@ -222,7 +222,7 @@ fn write_multiple_indexes() { } wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) @@ -286,7 +286,7 @@ fn overwrite_one_item_incremental() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -312,7 +312,7 @@ fn overwrite_one_item_incremental() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -341,7 +341,7 @@ fn delete_one_item_in_a_one_item_db() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -357,7 +357,7 @@ fn delete_one_item_in_a_one_item_db() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Root: Metadata { dimensions: 2, items: RoaringBitmap<[]>, roots: [], distance: "euclidean" } @@ -435,7 +435,7 @@ fn delete_one_item_in_a_descendant() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -452,7 +452,7 @@ fn delete_one_item_in_a_descendant() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) @@ -475,7 +475,7 @@ fn delete_one_leaf_in_a_split() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -495,7 +495,7 @@ fn delete_one_leaf_in_a_split() { wtxn.commit().unwrap(); // after deleting the leaf, the split node should be replaced by a descendant - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) @@ -517,7 +517,7 @@ fn delete_one_item_in_a_single_document_database() { writer.build(&mut wtxn, &mut rng, None).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderAngular { norm: 0.0 }, vector: [0.0000, 0.0000] }) @@ -533,7 +533,7 @@ fn delete_one_item_in_a_single_document_database() { writer.build(&mut wtxn, &mut rng, None).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Root: Metadata { dimensions: 2, items: RoaringBitmap<[]>, roots: [], distance: "angular" } @@ -554,7 +554,7 @@ fn delete_one_item() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -579,7 +579,7 @@ fn delete_one_item() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -603,7 +603,7 @@ fn delete_one_item() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -626,7 +626,7 @@ fn add_one_item_incrementally_in_an_empty_db() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Root: Metadata { dimensions: 2, items: RoaringBitmap<[]>, roots: [], distance: "euclidean" } @@ -638,7 +638,7 @@ fn add_one_item_incrementally_in_an_empty_db() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -657,7 +657,7 @@ fn add_one_item_incrementally_in_a_one_item_db() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -671,7 +671,7 @@ fn add_one_item_incrementally_in_a_one_item_db() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -692,7 +692,7 @@ fn add_one_item_incrementally_to_create_a_split_node() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -707,7 +707,7 @@ fn add_one_item_incrementally_to_create_a_split_node() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -732,7 +732,7 @@ fn add_one_item_incrementally() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -757,7 +757,7 @@ fn add_one_item_incrementally() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -784,7 +784,7 @@ fn add_one_item_incrementally() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -820,7 +820,7 @@ fn delete_extraneous_tree() { writer.build(&mut wtxn, &mut rng, None).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000, 0.0000] }) @@ -842,7 +842,7 @@ fn delete_extraneous_tree() { writer.build(&mut wtxn, &mut rng, Some(2)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000, 0.0000] }) @@ -862,7 +862,7 @@ fn delete_extraneous_tree() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000, 0.0000] }) @@ -889,7 +889,7 @@ fn reuse_node_id() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -914,7 +914,7 @@ fn reuse_node_id() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -937,7 +937,7 @@ fn reuse_node_id() { writer.build(&mut wtxn, &mut rng, Some(1)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) @@ -961,7 +961,7 @@ fn reuse_node_id() { writer.build(&mut wtxn, &mut rng, Some(2)).unwrap(); wtxn.commit().unwrap(); - insta::assert_display_snapshot!(handle, @r###" + insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] })