From d9e0e9ad792572bf72987cdd1925def26be9b8c4 Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Mon, 7 Nov 2016 22:56:47 +0000 Subject: [PATCH] Made various aesthetic changes. Normalized style headers, added item to CHANGELOG regarding imports. --- CHANGELOG.txt | 1 + README.md | 10 +++++----- rocksdb-sys/src/lib.rs | 1 - rocksdb-sys/src/test.rs | 1 - rocksdb-sys/tests/ffi.rs | 1 - src/lib.rs | 3 +-- test/test.rs | 15 +++++++++++++++ test/test_column_family.rs | 1 + test/test_iterator.rs | 15 +++++++++++++++ test/test_multithreaded.rs | 15 +++++++++++++++ test/test_rocksdb_options.rs | 16 +++++++++++++++- 11 files changed, 68 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 701eada..b571e42 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,5 +4,6 @@ Changelog 0.5 (in development) ~~~~~~~~~~~~~~~~~~~~ + * All imports of `rocksdb::rocksdb::*` should now be simply `rocksdb::*` (alexreg) * Add iterator_cf to snapshot (jezell) * Changelog started diff --git a/README.md b/README.md index 3af7091..7f013c2 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ rust-rocksdb [![Build Status](https://travis-ci.org/spacejam/rust-rocksdb.svg?branch=master)](https://travis-ci.org/spacejam/rust-rocksdb) [![crates.io](http://meritbadge.herokuapp.com/rocksdb)](https://crates.io/crates/rocksdb) -This library has been tested against RocksDB 3.13.1 on linux and OSX. The 0.4.1 crate should work with the Rust 1.9 stable and nightly releases as of 7/1/16. +This library has been tested against RocksDB 3.13.1 on Linux and OS X. The 0.4.1 crate should work with the Rust 1.9 stable and nightly releases as of 7/1/16. -### status +### Status - [x] basic open/put/get/delete/close - [x] rustic merge operator - [x] write batch (thanks @dgrnbrg!) @@ -46,7 +46,7 @@ fn main() { } ``` -###### Doing an atomic commit of several writes +###### Making an atomic commit of several writes ```rust extern crate rocksdb; use rocksdb::{DB, WriteBatch, Writable}; @@ -64,7 +64,7 @@ fn main() { } ``` -###### Getting an Iterator +###### Getting an `Iterator` ```rust extern crate rocksdb; use rocksdb::{DB, Direction, IteratorMode}; @@ -93,7 +93,7 @@ fn main() { } ``` -###### Getting an Iterator from a Snapshot +###### Getting an `Iterator` from a `Snapshot` ```rust extern crate rocksdb; use rocksdb::{DB, Direction}; diff --git a/rocksdb-sys/src/lib.rs b/rocksdb-sys/src/lib.rs index d6d4bb2..2b70f83 100644 --- a/rocksdb-sys/src/lib.rs +++ b/rocksdb-sys/src/lib.rs @@ -1,4 +1,3 @@ -// // Copyright 2014 Tyler Neely, 2016 Alex Regueiro // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/rocksdb-sys/src/test.rs b/rocksdb-sys/src/test.rs index 568e7a5..6d3aa79 100644 --- a/rocksdb-sys/src/test.rs +++ b/rocksdb-sys/src/test.rs @@ -1,4 +1,3 @@ -// // Copyright 2014 Tyler Neely // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/rocksdb-sys/tests/ffi.rs b/rocksdb-sys/tests/ffi.rs index 9f757e0..5a2a6d5 100644 --- a/rocksdb-sys/tests/ffi.rs +++ b/rocksdb-sys/tests/ffi.rs @@ -1,4 +1,3 @@ -// // Copyright 2016 Alex Regueiro // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/lib.rs b/src/lib.rs index 233cc91..25c91fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,9 +16,8 @@ extern crate libc; extern crate rocksdb_sys as ffi; -pub mod merge_operator; pub mod comparator; - +pub mod merge_operator; mod rocksdb; mod rocksdb_options; diff --git a/test/test.rs b/test/test.rs index 06e09ad..295d4b0 100644 --- a/test/test.rs +++ b/test/test.rs @@ -1,3 +1,18 @@ +// Copyright 2014 Tyler Neely +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + extern crate rocksdb; mod test_iterator; diff --git a/test/test_column_family.rs b/test/test_column_family.rs index 1f06eea..4e6695c 100644 --- a/test/test_column_family.rs +++ b/test/test_column_family.rs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // + use rocksdb::{DB, MergeOperands, Options, Writable}; #[test] diff --git a/test/test_iterator.rs b/test/test_iterator.rs index bfdb59e..c40f324 100644 --- a/test/test_iterator.rs +++ b/test/test_iterator.rs @@ -1,3 +1,18 @@ +// Copyright 2014 Tyler Neely +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + use rocksdb::{DB, Direction, IteratorMode, Options, Writable}; fn cba(input: &Box<[u8]>) -> Box<[u8]> { diff --git a/test/test_multithreaded.rs b/test/test_multithreaded.rs index 00c6466..57dabce 100644 --- a/test/test_multithreaded.rs +++ b/test/test_multithreaded.rs @@ -1,3 +1,18 @@ +// Copyright 2014 Tyler Neely +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + use rocksdb::{DB, Options, Writable}; use std::thread; use std::sync::Arc; diff --git a/test/test_rocksdb_options.rs b/test/test_rocksdb_options.rs index cf1accf..80ebe6c 100644 --- a/test/test_rocksdb_options.rs +++ b/test/test_rocksdb_options.rs @@ -1,5 +1,19 @@ -use rocksdb::{DB, Options}; +// Copyright 2014 Tyler Neely +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +use rocksdb::{DB, Options}; #[test] fn test_set_num_levels() {