Skip to content

Commit

Permalink
Deps: update to rocksdb 0.23 (#3456)
Browse files Browse the repository at this point in the history
New rocksdb release: https://docs.rs/crate/rocksdb/0.23.0

Bump MSRV to 1.71, which currently accounts for >97% of crates
downloads:
https://lib.rs/stats#rustc-usage
  • Loading branch information
luizirber authored Jan 10, 2025
1 parent 23b1a62 commit 8e96904
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.66.0"
toolchain: "1.71.1"

- uses: Swatinem/rust-cache@v2

- name: check if README matches MSRV defined here
run: grep '1.66.0' src/core/README.md
run: grep '1.71.1' src/core/README.md

- name: Check if it builds properly
run: |
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build:
os: ubuntu-22.04
tools:
python: "3.10"
rust: "1.70"
rust: "1.75"
apt_packages:
- llvm-dev
- libclang-dev
Expand Down
20 changes: 4 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
#cargo-llvm-cov
cargo-component
cargo-codspeed
cargo-semver-checks
#cargo-semver-checks
nixpkgs-fmt
];

Expand Down
10 changes: 7 additions & 3 deletions src/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2021"
readme = "README.md"
autoexamples = false
autobins = false
rust-version = "1.66.0"
rust-version = "1.71.1"

[lib]
name = "sourmash"
Expand Down Expand Up @@ -108,7 +108,11 @@ chrono = { version = "0.4.32", features = ["wasmbind"] }
wasm-bindgen-test = "0.3.42"

### These crates don't compile on wasm
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
rocksdb = { version = "0.22.0", optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.rocksdb]
version = "0.23.0"
optional = true
default-features = false
features = [ "bindgen-runtime", "snappy", "zstd" ]

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = "0.5.1"
2 changes: 1 addition & 1 deletion src/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ Development happens on github at

## Minimum supported Rust version

Currently the minimum supported Rust version is 1.66.0.
Currently the minimum supported Rust version is 1.71.1.
6 changes: 2 additions & 4 deletions src/core/src/encodings.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::hash::{BuildHasher, BuildHasherDefault, Hash, Hasher};
use std::hash::{BuildHasher, BuildHasherDefault, Hash};
use std::str;

use nohash_hasher::BuildNoHashHasher;
Expand Down Expand Up @@ -469,9 +469,7 @@ impl Colors {

fn compute_color(idxs: &IdxTracker) -> Color {
let s = BuildHasherDefault::<twox_hash::Xxh3Hash128>::default();
let mut hasher = s.build_hasher();
idxs.0.hash(&mut hasher);
hasher.finish()
s.hash_one(&idxs.0)
}

pub fn len(&self) -> usize {
Expand Down
9 changes: 3 additions & 6 deletions src/core/src/index/revindex/disk_revindex.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::cmp::max;
use std::hash::{BuildHasher, BuildHasherDefault, Hash, Hasher};
use std::hash::{BuildHasher, BuildHasherDefault};
use std::path::Path;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, RwLock};
Expand Down Expand Up @@ -30,9 +30,7 @@ const DB_VERSION: u8 = 1;

fn compute_color(idxs: &Datasets) -> Color {
let s = BuildHasherDefault::<twox_hash::Xxh3Hash128>::default();
let mut hasher = s.build_hasher();
idxs.hash(&mut hasher);
hasher.finish()
s.hash_one(idxs)
}

#[derive(Clone)]
Expand Down Expand Up @@ -354,8 +352,7 @@ impl RevIndexOps for RevIndex {

let name = [row.name(), row.filename(), row.md5()]
.into_iter()
.skip_while(|v| v.is_empty())
.next()
.find(|v| !v.is_empty())
.unwrap(); // guaranteed to succeed because `md5` always exists

Some((name.into(), size))
Expand Down

0 comments on commit 8e96904

Please sign in to comment.