Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitcarbon
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[carbon ".github/workflows/cargo-shear.yml"]
sourceRepository = https://github.com/mullvad/coding-guidelines.git
sourcePath = rust/.github/workflows/cargo-shear.yml
[carbon "src/testdata/inclusion-invalid.json"]
sourceRepository = https://github.com/rgdd/cctv.git
sourcePath = merkle/testdata/inclusion-invalid.json
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/cargo-shear.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Unused dependencies
on:
pull_request:
paths:
- .github/workflows/cargo-shear.yml
- "**/*.rs"
- "**/Cargo.toml"
workflow_dispatch:

permissions: {}

jobs:
cargo-shear:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install cargo-shear
uses: taiki-e/install-action@cargo-shear

- name: Run cargo shear
run: cargo shear
32 changes: 27 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
name = "sigsum"
version = "0.2.0"
edition = "2021"
license = "MIT"
homepage = "https://github.com/mullvad/sigsum-rs"
repository = "https://github.com/mullvad/sigsum-rs"
documentation = "https://docs.rs/sigsum"
description = """
A Rust library for using Sigsum transparency logs.
"""

documentation = "https://docs.rs/sigsum"
homepage = "https://github.com/mullvad/sigsum-rs"
repository = "https://github.com/mullvad/sigsum-rs"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -28,4 +27,27 @@ serde = { version = "1.0.190", features = ["derive"] }
serde_json = "1.0.107"

[lints.clippy]
allow_attributes = "warn"
as_ptr_cast_mut = "warn"
as_underscore = "warn"
borrow_as_ptr = "warn"
implicit_clone = "warn"
todo = "deny"
undocumented_unsafe_blocks = "warn"
unicode_not_nfc = "warn"
unused_async = "deny"
wildcard_dependencies = "deny"

[lints.rust]
absolute_paths_not_starting_with_crate = "deny"
# Easy to read style and opinionated best practices
explicit_outlives_requirements = "warn"
macro_use_extern_crate = "deny"
missing_abi = "deny"
# Security
non_ascii_idents = "forbid"
# Deny old style Rust
rust_2018_idioms = { level = "deny", priority = -1 }
single_use_lifetimes = "warn"
unused_lifetimes = "warn"
unused_macro_rules = "warn"
8 changes: 4 additions & 4 deletions src/io/ascii/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl SignedTreeHead {
})
}

#[allow(unused_must_use)]
#[expect(unused_must_use)]
pub fn to_ascii(&self) -> String {
let mut ascii = String::new();
writeln!(ascii, "{SIZE_FIELD}={}", self.size);
Expand Down Expand Up @@ -77,7 +77,7 @@ impl InclusionProof {
})
}

#[allow(unused_must_use)]
#[expect(unused_must_use)]
pub fn to_ascii(&self) -> String {
let mut ascii = String::new();
writeln!(ascii, "{LEAF_INDEX_FIELD}={}", self.leaf_index);
Expand All @@ -101,7 +101,7 @@ impl Protoleaf {
})
}

#[allow(unused_must_use)]
#[expect(unused_must_use)]
pub fn to_ascii(&self) -> String {
let mut ascii = String::new();
writeln!(ascii, "{MESSAGE_FIELD}={:x}", self.message);
Expand Down Expand Up @@ -143,7 +143,7 @@ impl SigsumSignature {
})
}

#[allow(unused_must_use)]
#[expect(unused_must_use)]
pub fn to_ascii(&self) -> String {
let mut ascii = String::new();
writeln!(ascii, "{VERSION_FIELD}=2");
Expand Down
2 changes: 1 addition & 1 deletion src/policy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub struct Logs<'a> {
inner: std::collections::hash_map::Iter<'a, Hash, Entity>,
}

impl<'a> Iterator for Logs<'a> {
impl Iterator for Logs<'_> {
type Item = Log;

fn next(&mut self) -> Option<Self::Item> {
Expand Down