Merge branch 'main' into other
Some checks are pending
Deny / audit (push) Waiting to run

This commit is contained in:
hinto.janai 2025-01-16 11:44:58 -05:00
commit 13f5ed9dd0
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
8 changed files with 26 additions and 21 deletions

View file

@ -31,8 +31,11 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with: with:
submodules: recursive toolchain: stable
components: rustfmt
- name: Format - name: Format
run: cargo fmt --all --check run: cargo fmt --all --check

View file

@ -25,9 +25,16 @@ jobs:
~/.cargo ~/.cargo
target target
key: deny key: deny
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Install dependencies - name: Install dependencies
run: cargo install cargo-deny --locked run: cargo install cargo-deny --locked
- name: Deny - name: Deny

View file

@ -40,12 +40,6 @@ jobs:
path: target/debug path: target/debug
key: doc key: doc
# Packages other than `Boost` used by `Monero` are listed here.
# https://github.com/monero-project/monero/blob/c444a7e002036e834bfb4c68f04a121ce1af5825/.github/workflows/build.yml#L71
- name: Install dependencies (Linux)
run: sudo apt install -y libboost-dev
- name: Documentation - name: Documentation
run: cargo +nightly doc --workspace --all-features run: cargo +nightly doc --workspace --all-features

View file

@ -1,5 +1,5 @@
[workspace] [workspace]
resolver = "2" resolver = "3"
members = [ members = [
# Binaries # Binaries
"binaries/cuprated", "binaries/cuprated",
@ -288,6 +288,9 @@ zero_repeat_side_effects = "deny"
non_zero_suggestions = "deny" non_zero_suggestions = "deny"
manual_is_power_of_two = "deny" manual_is_power_of_two = "deny"
used_underscore_items = "deny" used_underscore_items = "deny"
unnecessary_map_or = "deny"
map_all_any_identity = "deny"
unnecessary_literal_bound = "deny"
# Warm # Warm
cast_possible_truncation = "deny" cast_possible_truncation = "deny"

View file

@ -1 +1,2 @@
# <https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms>
upper-case-acronyms-aggressive = true upper-case-acronyms-aggressive = true

View file

@ -24,7 +24,7 @@ fn set_commit_env() {
.to_lowercase(); .to_lowercase();
// Commit hash should always be 40 bytes long. // Commit hash should always be 40 bytes long.
assert_eq!(commit.as_bytes().len(), 40); assert_eq!(commit.len(), 40);
println!("cargo:rustc-env=COMMIT={commit}"); println!("cargo:rustc-env=COMMIT={commit}");
} }

View file

@ -82,13 +82,13 @@ impl Serialize for Version {
impl std::fmt::Display for Version { impl std::fmt::Display for Version {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, r#"{}"#, Self::TWO) write!(f, "{}", Self::TWO)
} }
} }
impl std::fmt::Debug for Version { impl std::fmt::Debug for Version {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, r#"{}"#, Self::TWO) write!(f, "{}", Self::TWO)
} }
} }

View file

@ -15,10 +15,7 @@ use crate::{config::SyncMode, constants::DATABASE_DATA_FILENAME, resize::ResizeA
/// use cuprate_database::config::*; /// use cuprate_database::config::*;
/// assert_eq!(READER_THREADS_DEFAULT.get(), 126); /// assert_eq!(READER_THREADS_DEFAULT.get(), 126);
/// ``` /// ```
pub const READER_THREADS_DEFAULT: NonZeroUsize = match NonZeroUsize::new(126) { pub const READER_THREADS_DEFAULT: NonZeroUsize = NonZeroUsize::new(126).unwrap();
Some(n) => n,
None => unreachable!(),
};
//---------------------------------------------------------------------------------------------------- ConfigBuilder //---------------------------------------------------------------------------------------------------- ConfigBuilder
/// Builder for [`Config`]. /// Builder for [`Config`].