diff --git a/examples/iterator.rs b/examples/iterator.rs index f562b70..445dc37 100644 --- a/examples/iterator.rs +++ b/examples/iterator.rs @@ -35,7 +35,8 @@ fn main() { // returns the (key, value) tuples in order. let mut iter = store.iter_start(&reader).unwrap(); while let Some(Ok((country, city))) = iter.next() { - println!("{}, {:?}", str::from_utf8(country).unwrap(), city); + let country = str::from_utf8(country).unwrap(); + println!("{country}, {city:?}"); } println!(); @@ -44,14 +45,14 @@ fn main() { // than the given key. let mut iter = store.iter_from(&reader, "Japan").unwrap(); while let Some(Ok((country, city))) = iter.next() { - println!("{}, {:?}", str::from_utf8(country).unwrap(), city); + println!("{}, {city:?}", str::from_utf8(country).unwrap()); } println!(); println!("Iterating from the given prefix..."); let mut iter = store.iter_from(&reader, "Un").unwrap(); while let Some(Ok((country, city))) = iter.next() { - println!("{}, {:?}", str::from_utf8(country).unwrap(), city); + println!("{}, {city:?}", str::from_utf8(country).unwrap()); } } diff --git a/src/backend/impl_lmdb/arch_migrator.rs b/src/backend/impl_lmdb/arch_migrator.rs index 05fcf7f..6a91db1 100644 --- a/src/backend/impl_lmdb/arch_migrator.rs +++ b/src/backend/impl_lmdb/arch_migrator.rs @@ -545,7 +545,7 @@ impl Migrator { out.write_all(b"VERSION=3\n")?; out.write_all(b"format=bytevalue\n")?; if let Some(database) = database { - writeln!(out, "database={}", database)?; + writeln!(out, "database={database}")?; } out.write_all(b"type=btree\n")?; writeln!(out, "mapsize={}", meta_data.mm_mapsize)?; @@ -556,12 +556,12 @@ impl Migrator { for (key, value) in pairs { out.write_all(b" ")?; for byte in key { - write!(out, "{:02x}", byte)?; + write!(out, "{byte:02x}")?; } out.write_all(b"\n")?; out.write_all(b" ")?; for byte in value { - write!(out, "{:02x}", byte)?; + write!(out, "{byte:02x}")?; } out.write_all(b"\n")?; } diff --git a/src/bin/dump.rs b/src/bin/dump.rs index 8fa7b01..c0e12b9 100644 --- a/src/bin/dump.rs +++ b/src/bin/dump.rs @@ -29,7 +29,7 @@ fn main() -> Result<(), LmdbArchMigrateError> { Some(str) => Some(str), }; } - str => return Err(format!("arg -{} not recognized", str).into()), + str => return Err(format!("arg -{str} not recognized").into()), } } else { if env_path.is_some() { diff --git a/tests/env-lmdb.rs b/tests/env-lmdb.rs index 2c32d69..e3aca39 100644 --- a/tests/env-lmdb.rs +++ b/tests/env-lmdb.rs @@ -179,7 +179,7 @@ fn test_open_from_builder_with_dir_1() { #[should_panic(expected = "rkv: UnsuitableEnvironmentPath(\"bogus\")")] fn test_open_from_builder_with_dir_2() { let root = Path::new("bogus"); - println!("Root path: {:?}", root); + println!("Root path: {root:?}"); assert!(!root.is_dir()); let mut builder = Rkv::environment_builder::(); @@ -897,10 +897,10 @@ fn test_concurrent_read_transactions_prohibited() { match second { Err(StoreError::ReadTransactionAlreadyExists(t)) => { - println!("Thread was {:?}", t); + println!("Thread was {t:?}"); } Err(e) => { - println!("Got error {:?}", e); + println!("Got error {e:?}"); } _ => { panic!("Expected error."); @@ -1045,7 +1045,7 @@ fn test_stat() { let k = Rkv::new::(root.path()).expect("new succeeded"); for i in 0..5 { let sk = k - .open_integer(&format!("sk{}", i)[..], StoreOptions::create()) + .open_integer(&format!("sk{i}")[..], StoreOptions::create()) .expect("opened"); { let mut writer = k.write().expect("writer"); diff --git a/tests/env-safe.rs b/tests/env-safe.rs index 2811126..9c20e39 100644 --- a/tests/env-safe.rs +++ b/tests/env-safe.rs @@ -115,7 +115,7 @@ fn test_open_from_builder_with_dir_safe_1() { #[should_panic(expected = "rkv: UnsuitableEnvironmentPath(\"bogus\")")] fn test_open_from_builder_with_dir_safe_2() { let root = Path::new("bogus"); - println!("Root path: {:?}", root); + println!("Root path: {root:?}"); assert!(!root.is_dir()); let mut builder = Rkv::environment_builder::(); diff --git a/tests/test_txn.rs b/tests/test_txn.rs index ffc1d1f..1e8fdfb 100644 --- a/tests/test_txn.rs +++ b/tests/test_txn.rs @@ -51,8 +51,8 @@ fn read_many() { let mut writer = k.write().expect("env write lock"); for id in 0..30_u64 { - let value = format!("value{}", id); - let date = format!("2019-06-{}", id); + let value = format!("value{id}"); + let date = format!("2019-06-{id}"); put_id_field(&mut writer, datestore, &date, id); put_id_field(&mut writer, valuestore, &value, id); put_sample(&mut writer, samplestore, id, &value); @@ -60,26 +60,26 @@ fn read_many() { // now we read in the same transaction for id in 0..30_u64 { - let value = format!("value{}", id); - let date = format!("2019-06-{}", id); + let value = format!("value{id}"); + let date = format!("2019-06-{id}"); let ids = get_ids_by_field(&writer, datestore, &date); let ids2 = get_ids_by_field(&writer, valuestore, &value); let samples = get_samples(&writer, samplestore, &ids); let samples2 = get_samples(&writer, samplestore, &ids2); - println!("{:?}, {:?}", samples, samples2); + println!("{samples:?}, {samples2:?}"); } } { let reader = k.read().expect("env read lock"); for id in 0..30_u64 { - let value = format!("value{}", id); - let date = format!("2019-06-{}", id); + let value = format!("value{id}"); + let date = format!("2019-06-{id}"); let ids = get_ids_by_field(&reader, datestore, &date); let ids2 = get_ids_by_field(&reader, valuestore, &value); let samples = get_samples(&reader, samplestore, &ids); let samples2 = get_samples(&reader, samplestore, &ids2); - println!("{:?}, {:?}", samples, samples2); + println!("{samples:?}, {samples2:?}"); } } }