Skip to content

Commit 71232df

Browse files
Merge PR #21
2 parents 7ae8cc2 + fb6f543 commit 71232df

5 files changed

Lines changed: 58 additions & 10 deletions

File tree

.gitcarbon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[carbon ".github/workflows/cargo-shear.yml"]
2+
sourceRepository = https://github.com/mullvad/coding-guidelines.git
3+
sourcePath = rust/.github/workflows/cargo-shear.yml
14
[carbon "src/testdata/inclusion-invalid.json"]
25
sourceRepository = https://github.com/rgdd/cctv.git
36
sourcePath = merkle/testdata/inclusion-invalid.json

.github/workflows/cargo-shear.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Unused dependencies
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/cargo-shear.yml
7+
- "**/*.rs"
8+
- "**/Cargo.toml"
9+
workflow_dispatch:
10+
11+
permissions: {}
12+
13+
jobs:
14+
cargo-shear:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install cargo-shear
20+
uses: taiki-e/install-action@cargo-shear
21+
22+
- name: Run cargo shear
23+
run: cargo shear

Cargo.toml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
name = "sigsum"
33
version = "0.2.0"
44
edition = "2021"
5-
license = "MIT"
6-
homepage = "https://github.com/mullvad/sigsum-rs"
7-
repository = "https://github.com/mullvad/sigsum-rs"
8-
documentation = "https://docs.rs/sigsum"
95
description = """
106
A Rust library for using Sigsum transparency logs.
117
"""
12-
8+
documentation = "https://docs.rs/sigsum"
9+
homepage = "https://github.com/mullvad/sigsum-rs"
10+
repository = "https://github.com/mullvad/sigsum-rs"
11+
license = "MIT"
1312

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

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

3029
[lints.clippy]
30+
allow_attributes = "warn"
31+
as_ptr_cast_mut = "warn"
32+
as_underscore = "warn"
33+
borrow_as_ptr = "warn"
34+
implicit_clone = "warn"
3135
todo = "deny"
36+
undocumented_unsafe_blocks = "warn"
37+
unicode_not_nfc = "warn"
38+
unused_async = "deny"
39+
wildcard_dependencies = "deny"
40+
41+
[lints.rust]
42+
absolute_paths_not_starting_with_crate = "deny"
43+
# Easy to read style and opinionated best practices
44+
explicit_outlives_requirements = "warn"
45+
macro_use_extern_crate = "deny"
46+
missing_abi = "deny"
47+
# Security
48+
non_ascii_idents = "forbid"
49+
# Deny old style Rust
50+
rust_2018_idioms = { level = "deny", priority = -1 }
51+
single_use_lifetimes = "warn"
52+
unused_lifetimes = "warn"
53+
unused_macro_rules = "warn"

src/io/ascii/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl SignedTreeHead {
4545
})
4646
}
4747

48-
#[allow(unused_must_use)]
48+
#[expect(unused_must_use)]
4949
pub fn to_ascii(&self) -> String {
5050
let mut ascii = String::new();
5151
writeln!(ascii, "{SIZE_FIELD}={}", self.size);
@@ -77,7 +77,7 @@ impl InclusionProof {
7777
})
7878
}
7979

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

104-
#[allow(unused_must_use)]
104+
#[expect(unused_must_use)]
105105
pub fn to_ascii(&self) -> String {
106106
let mut ascii = String::new();
107107
writeln!(ascii, "{MESSAGE_FIELD}={:x}", self.message);
@@ -143,7 +143,7 @@ impl SigsumSignature {
143143
})
144144
}
145145

146-
#[allow(unused_must_use)]
146+
#[expect(unused_must_use)]
147147
pub fn to_ascii(&self) -> String {
148148
let mut ascii = String::new();
149149
writeln!(ascii, "{VERSION_FIELD}=2");

src/policy/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub struct Logs<'a> {
123123
inner: std::collections::hash_map::Iter<'a, Hash, Entity>,
124124
}
125125

126-
impl<'a> Iterator for Logs<'a> {
126+
impl Iterator for Logs<'_> {
127127
type Item = Log;
128128

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

0 commit comments

Comments
 (0)