updated modules to conform to 2018 edition standards

without.crypto
Rick Richardson 5 years ago
parent 66bf647fd2
commit 2c6ad411ae
  1. 1
      Cargo.toml
  2. 6
      examples/iterator.rs
  3. 6
      examples/simple-store.rs
  4. 8
      src/env.rs
  5. 3
      src/error.rs
  6. 8
      src/integer.rs
  7. 31
      src/lib.rs
  8. 5
      src/manager.rs
  9. 4
      src/readwrite.rs
  10. 4
      src/value.rs

@ -9,6 +9,7 @@ repository = "https://github.com/mozilla/rkv"
readme = "README.md"
keywords = ["lmdb", "database", "storage"]
categories = ["database"]
edition = "2018"
[features]
default = []

@ -7,10 +7,10 @@
//!
//! cargo run --example iterator
extern crate rkv;
extern crate tempfile;
use rkv;
use tempfile;
use rkv::{
use self::rkv::{
Manager,
Rkv,
Store,

@ -7,10 +7,10 @@
//!
//! cargo run --example simple-store
extern crate rkv;
extern crate tempfile;
use rkv;
use tempfile;
use rkv::{
use self::rkv::{
Manager,
Rkv,
Value,

@ -23,9 +23,9 @@ use lmdb::{
EnvironmentBuilder,
};
use error::StoreError;
use crate::error::StoreError;
use integer::{
use crate::integer::{
IntegerReader,
IntegerStore,
IntegerWriter,
@ -33,7 +33,7 @@ use integer::{
PrimitiveInt,
};
use readwrite::{
use crate::readwrite::{
Reader,
Store,
Writer,
@ -201,7 +201,7 @@ mod tests {
};
use super::*;
use *;
use crate::*;
/// We can't open a directory that doesn't exist.
#[test]

@ -12,8 +12,9 @@ use std::path::PathBuf;
use bincode;
use lmdb;
use failure::Fail;
use value::Type;
use crate::value::Type;
#[derive(Debug, Fail)]
pub enum DataError {

@ -16,14 +16,14 @@ use serde::Serialize;
use lmdb::Database;
use error::{
use crate::error::{
DataError,
StoreError,
};
use value::Value;
use crate::value::Value;
use readwrite::{
use crate::readwrite::{
Reader,
Store,
Writer,
@ -150,7 +150,7 @@ mod tests {
use std::fs;
use super::*;
use *;
use crate::*;
#[test]
fn test_integer_keys() {

@ -168,19 +168,12 @@
#![allow(dead_code)]
#[macro_use]
extern crate arrayref;
#[macro_use]
extern crate failure;
#[macro_use]
extern crate lazy_static;
extern crate bincode;
extern crate lmdb;
extern crate ordered_float;
extern crate serde; // So we can specify trait bounds. Everything else is bincode.
extern crate url;
extern crate uuid;
use bincode;
use lmdb;
use ordered_float;
use serde; // So we can specify trait bounds. Everything else is bincode.
use url;
use uuid;
pub use lmdb::{
DatabaseFlags,
@ -196,29 +189,29 @@ mod manager;
mod readwrite;
pub mod value;
pub use env::Rkv;
pub use self::env::Rkv;
pub use error::{
pub use self::error::{
DataError,
StoreError,
};
pub use integer::{
pub use self::integer::{
IntegerReader,
IntegerStore,
IntegerWriter,
PrimitiveInt,
};
pub use manager::Manager;
pub use self::manager::Manager;
pub use readwrite::{
pub use self::readwrite::{
Reader,
Store,
Writer,
};
pub use value::{
pub use self::value::{
OwnedValue,
Value,
};

@ -8,6 +8,7 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
use lazy_static::lazy_static;
use std::collections::BTreeMap;
use std::io::{
@ -32,9 +33,9 @@ use std::sync::{
use url::Url;
use error::StoreError;
use crate::error::StoreError;
use Rkv;
use crate::Rkv;
/// A process is only permitted to have one open handle to each Rkv environment.
/// This manager exists to enforce that constraint: don't open environments directly.

@ -24,9 +24,9 @@ use lmdb::{
use lmdb::WriteFlags;
use error::StoreError;
use crate::error::StoreError;
use value::Value;
use crate::value::Value;
fn read_transform(val: Result<&[u8], lmdb::Error>) -> Result<Option<Value>, StoreError> {
match val {

@ -9,7 +9,7 @@
// specific language governing permissions and limitations under the License.
use ordered_float::OrderedFloat;
use arrayref::array_ref;
use bincode::{
deserialize,
serialize,
@ -20,7 +20,7 @@ use uuid::{
Uuid,
};
use error::DataError;
use crate::error::DataError;
/// We define a set of types, associated with simple integers, to annotate values
/// stored in LMDB. This is to avoid an accidental 'cast' from a value of one type

Loading…
Cancel
Save