Avoids unsafe everywhere in the library

pull/22/head
Tpt 5 years ago
parent 868f1f20ce
commit 1f903335ff
  1. 2
      lib/src/lib.rs
  2. 3
      lib/src/store/rocksdb.rs

@ -41,7 +41,7 @@
missing_copy_implementations, missing_copy_implementations,
trivial_casts, trivial_casts,
trivial_numeric_casts, trivial_numeric_casts,
//TODO unsafe_code, unsafe_code,
unused_qualifications unused_qualifications
)] )]
#![warn( #![warn(

@ -141,7 +141,8 @@ impl StrLookup for RocksDbStoreConnection<'_> {
.store .store
.db .db
.get_cf(self.id2str_cf, &id.to_le_bytes())? .get_cf(self.id2str_cf, &id.to_le_bytes())?
.map(|v| unsafe { String::from_utf8_unchecked(v) })) .map(String::from_utf8)
.transpose()?)
} }
} }

Loading…
Cancel
Save