Skip to content

Commit

Permalink
Check in CI compatibility with MSRV (rust-rocksdb#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksuss authored Feb 10, 2023
1 parent 1c879f0 commit e646999
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: RocksDB CI

on: [push, pull_request]
env:
RUST_VERSION: 1.60.0

jobs:
fmt:
Expand All @@ -12,7 +14,7 @@ jobs:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt
profile: minimal
override: true
Expand All @@ -31,7 +33,7 @@ jobs:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ env.RUST_VERSION }}
components: clippy
profile: minimal
override: true
Expand Down Expand Up @@ -69,7 +71,7 @@ jobs:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust || 'stable' }}
toolchain: ${{ env.RUST_VERSION }}
target: ${{ matrix.target }}
profile: minimal
override: true
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "rocksdb"
description = "Rust wrapper for Facebook's RocksDB embeddable database"
version = "0.20.0"
edition = "2018"
rust-version = "1.60"
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"]
repository = "https://github.com/rust-rocksdb/rust-rocksdb"
license = "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions librocksdb-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "librocksdb-sys"
version = "0.10.0+7.9.2"
edition = "2018"
rust-version = "1.60"
authors = ["Karl Hobley <karlhobley10@gmail.com>", "Arkadiy Paronyan <arkadiy@ethcore.io>"]
license = "MIT/Apache-2.0/BSD-3-Clause"
description = "Native bindings to librocksdb"
Expand Down
10 changes: 4 additions & 6 deletions src/transactions/transaction_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type DefaultThreadMode = crate::MultiThreaded;
/// {
/// let db: TransactionDB = TransactionDB::open_default(path).unwrap();
/// db.put(b"my key", b"my value").unwrap();
///
///
/// // create transaction
/// let txn = db.transaction();
/// txn.put(b"key2", b"value2");
Expand Down Expand Up @@ -359,11 +359,9 @@ impl<T: ThreadMode> TransactionDB<T> {
name: &str,
opts: &Options,
) -> Result<*mut ffi::rocksdb_column_family_handle_t, Error> {
let Ok(cf_name) = CString::new(name.as_bytes()) else {
return Err(Error::new(
"Failed to convert path to CString when creating cf".to_owned(),
));
};
let cf_name = CString::new(name.as_bytes()).map_err(|_| {
Error::new("Failed to convert path to CString when creating cf".to_owned())
})?;

Ok(unsafe {
ffi_try!(ffi::rocksdb_transactiondb_create_column_family(
Expand Down

0 comments on commit e646999

Please sign in to comment.