Skip to content

Commit 8971fb5

Browse files
committed
Tune lints for 1.87 Rust
1 parent ebdd77e commit 8971fb5

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

.clippy.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ absolute-paths-allowed-crates = [
88
"prometheus",
99
]
1010

11+
allow-expect-in-tests = true
12+
1113
standard-macro-braces = [
1214
{ name = "assert", brace = "(" },
1315
{ name = "assert_eq", brace = "(" },

CONTRIBUTING.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Additional rules, not handled by [rustfmt] and [Clippy] are described below.
2525

2626
```rust
2727
#[allow(clippy::mut_mut)]
28-
#[derive(smart_default::SmartDefault, Debug, Deserialize, Serialize)]
28+
#[derive(Debug, Deserialize, Serialize, smart_default::SmartDefault)]
2929
#[serde(deny_unknown_fields)]
3030
struct User {
3131
#[serde(default)]
@@ -37,7 +37,7 @@ struct User {
3737

3838
```rust
3939
#[serde(deny_unknown_fields)]
40-
#[derive(smart_default::SmartDefault, Debug, Deserialize, Serialize)]
40+
#[derive(Debug, Deserialize, Serialize, smart_default::SmartDefault)]
4141
#[allow(clippy::mut_mut)]
4242
struct User {
4343
id: u64,
@@ -51,6 +51,13 @@ struct User {
5151
}
5252
```
5353

54+
```rust
55+
#[derive(smart_default::SmartDefault, Debug, Deserialize, Serialize)]
56+
struct User {
57+
id: u64,
58+
}
59+
```
60+
5461

5562
### Markdown in docs
5663

@@ -64,9 +71,9 @@ Other **code definitions** should be **referred via ```[`Entity`]``` marking** (
6471

6572
```rust
6673
/// Type of [`User`]'s unique identifier.
67-
///
74+
///
6875
/// # Constraints
69-
///
76+
///
7077
/// - It **must not be zero**.
7178
/// - It _should not_ overflow [`i64::MAX`] due to usage in database.
7279
struct UserId(u64);
@@ -78,9 +85,9 @@ struct UserId(u64);
7885

7986
```rust
8087
/// Type of [`User`]'s unique identifier.
81-
///
88+
///
8289
/// ## Constraints
83-
///
90+
///
8491
/// - It **must not be zero**.
8592
/// - It _should not_ overflow [`i64::MAX`] due to usage in database.
8693
struct UserId(u64);
@@ -90,9 +97,9 @@ struct UserId(u64);
9097

9198
```rust
9299
/// Type of User's unique identifier.
93-
///
100+
///
94101
/// # Constraints
95-
///
102+
///
96103
/// - It **must not be zero**.
97104
/// - It _should not_ overflow `i64::MAX` due to usage in database.
98105
struct UserId(u64);
@@ -102,9 +109,9 @@ struct UserId(u64);
102109

103110
```rust
104111
/// Type of [`User`]'s unique identifier.
105-
///
112+
///
106113
/// # Constraints
107-
///
114+
///
108115
/// - It __must not be zero__.
109116
/// - It *should not* overflow [`i64::MAX`] due to usage in database.
110117
struct UserId(u64);

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
clippy::shadow_unrelated,
129129
clippy::significant_drop_in_scrutinee,
130130
clippy::significant_drop_tightening,
131+
clippy::single_option_map,
131132
clippy::str_to_string,
132133
clippy::string_add,
133134
clippy::string_lit_as_bytes,

src/metric.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ impl<M> Fallible<M> {
122122
/// # Errors
123123
///
124124
/// If this [`Fallible`] contains a [`prometheus::Error`].
125-
#[expect(clippy::missing_const_for_fn, reason = "non-const deref coercion")]
126125
pub fn as_ref(&self) -> Result<&Arc<Metric<M>>, &prometheus::Error> {
127126
(*self.0).as_ref()
128127
}

0 commit comments

Comments
 (0)