Skip to content

Commit 2ea01cb

Browse files
committed
2024
1 parent 54d78b9 commit 2ea01cb

File tree

117 files changed

+206
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+206
-182
lines changed

Cargo.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ members = [
88
"xtask",
99
]
1010
exclude = ["services/benchers", "services/cargo-bencher"]
11-
resolver = "2"
11+
resolver = "3"
1212

1313
[workspace.package]
1414
homepage = "https://bencher.dev"
1515
version = "0.5.1"
1616
authors = ["Everett Pompeii <[email protected]>"]
17-
edition = "2021"
17+
edition = "2024"
1818
license-file = "LICENSE.md"
1919

2020
[workspace.dependencies]
@@ -111,7 +111,6 @@ single_use_lifetimes = "warn"
111111
trivial_casts = "warn"
112112
trivial_numeric_casts = "warn"
113113
unsafe_code = "warn"
114-
unsafe_op_in_unsafe_fn = "warn"
115114
unused_crate_dependencies = "warn"
116115
unused_import_braces = "warn"
117116
unused_lifetimes = "warn"
@@ -130,15 +129,17 @@ multiple_crate_versions = "allow" # Checks to see if multiple versions o
130129
pedantic = { level = "warn", priority = -1 }
131130
missing_errors_doc = "allow" # Checks the doc comments of publicly visible functions that return a Result type and warns if there is no # Errors section.
132131
missing_panics_doc = "allow" # Checks the doc comments of publicly visible functions that may panic and warns if there is no # Panics section.
133-
module_name_repetitions = "allow" # Detects type names that are prefixed or suffixed by the containing module’s name.
134132
must_use_candidate = "allow" # Checks for public functions that have no #[must_use] attribute, but return something not already marked must-use, have no mutable arg and mutate no statics.
135133
# restriction
136134
absolute_paths = "warn" # Checks for usage of items through absolute paths, like std::env::current_dir.
135+
allow_attributes = "warn" # Checks for usage of the #[allow] attribute and suggests replacing it with the #[expect]
136+
as_pointer_underscore = "warn" # Checks for the usage of as *const _ or as *mut _ conversion using inferred type.
137137
as_underscore = "warn" # Checks for the usage of as _ conversion using inferred type.
138138
big_endian_bytes = "warn" # Checks for the usage of the to_be_bytes method and/or the function from_be_bytes.
139139
cfg_not_test = "warn" # Checks for usage of cfg that excludes code from test builds. (i.e., #[cfg(not(test))])
140140
dbg_macro = "warn" # Checks for usage of the dbg! macro.
141141
decimal_literal_representation = "warn" # Warns if there is a better representation for a numeric literal.
142+
doc_include_without_cfg = "warn" # Checks if included files in doc comments are included only for cfg(doc).
142143
error_impl_error = "warn" # Checks for types named Error that implement Error.
143144
empty_enum_variants_with_brackets = "warn" # Finds enum variants without fields that are declared with empty brackets.
144145
exit = "warn" # Detects calls to the exit() function which terminates the program.
@@ -162,17 +163,21 @@ large_include_file = "warn" # Checks for the inclusion of large f
162163
little_endian_bytes = "warn" # Checks for the usage of the to_le_bytes method and/or the function from_le_bytes.
163164
lossy_float_literal = "warn" # Checks for whole number float literals that cannot be represented as the underlying type without loss.
164165
map_err_ignore = "warn" # Checks for instances of map_err(|_| Some::Enum)
166+
map_with_unused_argument_over_ranges = "warn" # Checks for Iterator::map over ranges without using the parameter which could be more clearly expressed using std::iter::repeat(...).take(...) or std::iter::repeat_n.
165167
mem_forget = "warn" # Checks for usage of std::mem::forget(t) where t is Drop or has a field that implements Drop.
166168
missing_assert_message = "warn" # Checks assertions without a custom panic message.
167169
missing_asserts_for_indexing = "warn" # Checks for repeated slice indexing without asserting beforehand that the length is greater than the largest index used to index into the slice.
168170
mixed_read_write_in_expression = "warn" # Checks for a read and a write to the same variable where whether the read occurs before or after the write depends on the evaluation order of sub-expressions.
169171
modulo_arithmetic = "warn" # Checks for modulo arithmetic.
170172
multiple_inherent_impl = "warn" # Checks for multiple inherent implementations of a struct
171173
mutex_atomic = "warn" # Checks for usage of Mutex<X> where an atomic will do.
174+
mutex_integer = "warn" # Checks for usage of Mutex<X> where X is an integral type.
172175
needless_raw_strings = "warn" # Checks for raw string literals where a string literal can be used instead.
176+
non_zero_suggestions = "warn" # Checks for conversions from NonZero types to regular integer types, and suggests using NonZero types for the target as well.
173177
panic = "warn" # Checks for usage of panic!.
174178
partial_pub_fields = "warn" # Checks whether partial fields of a struct are public.
175179
pathbuf_init_then_push = "warn" # Checks for calls to push immediately after creating a new PathBuf.
180+
precedence_bits = "warn" # Checks for bit shifting operations combined with bit masking/combining operators and suggest using parentheses.
176181
print_stdout = "warn" # Checks for printing on stdout. The purpose of this lint is to catch debugging remnants.
177182
print_stderr = "warn" # Checks for printing on stderr. The purpose of this lint is to catch debugging remnants.
178183
rc_buffer = "warn" # Checks for Rc<T> and Arc<T> when T is a mutable buffer type such as String or Vec.
@@ -201,6 +206,7 @@ unnecessary_safety_doc = "warn" # Checks for the doc comments of publ
201206
unnecessary_self_imports = "warn" # Checks for imports ending in ::{self}.
202207
unreachable = "warn" # Checks for usage of unreachable!.
203208
unused_result_ok = "warn" # Checks for calls to Result::ok() without using the returned Option.
209+
unused_trait_names = "warn" # Checks for `use Trait` where the Trait is only used for its methods and not referenced by a path directly.
204210
unwrap_used = "warn" # Checks for .unwrap() or .unwrap_err() calls on Results and .unwrap() call on Options.
205211
use_debug = "warn" # Checks for usage of Debug formatting. The purpose of this lint is to catch debugging remnants.
206212
verbose_file_reads = "warn" # Checks for usage of File::read_to_end and File::read_to_string.

clippy.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
absolute-paths-allowed-crates = ["diesel"]
44
absolute-paths-max-segments = 3
55

6-
allow-unwrap-in-tests = true
6+
allow-dbg-in-tests = true
77
allow-expect-in-tests = true
8+
allow-indexing-slicing-in-tests = true
9+
allow-print-in-tests = true
10+
allow-unwrap-in-tests = true

lib/api_organizations/src/members.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use bencher_schema::{
2222
schema, INVITE_TOKEN_TTL,
2323
};
2424
use diesel::{
25-
BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl, TextExpressionMethods,
25+
BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _, TextExpressionMethods as _,
2626
};
2727
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
2828
use schemars::JsonSchema;

lib/api_organizations/src/organizations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use bencher_schema::{
1818
schema,
1919
};
2020
use diesel::{
21-
BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl, TextExpressionMethods,
21+
BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _, TextExpressionMethods as _,
2222
};
2323
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
2424
use schemars::JsonSchema;

lib/api_organizations/src/plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use bencher_schema::{
2626
},
2727
schema,
2828
};
29-
use diesel::{BelongingToDsl, ExpressionMethods, QueryDsl, RunQueryDsl};
29+
use diesel::{BelongingToDsl as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _};
3030
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
3131
use schemars::JsonSchema;
3232
use serde::Deserialize;

lib/api_organizations/src/projects.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use bencher_schema::{
2727
schema,
2828
};
2929
use diesel::{
30-
BelongingToDsl, BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl,
31-
TextExpressionMethods,
30+
BelongingToDsl as _, BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _,
31+
TextExpressionMethods as _,
3232
};
3333
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
3434
use schemars::JsonSchema;

lib/api_organizations/src/usage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use bencher_schema::{
1818
user::auth::{AuthUser, BearerToken},
1919
},
2020
};
21-
use diesel::{BelongingToDsl, RunQueryDsl};
21+
use diesel::{BelongingToDsl as _, RunQueryDsl as _};
2222
use dropshot::{endpoint, HttpError, Path, RequestContext};
2323
use schemars::JsonSchema;
2424
use serde::Deserialize;

lib/api_projects/src/alerts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use bencher_schema::{
1717
},
1818
schema,
1919
};
20-
use diesel::{BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl, SelectableHelper};
20+
use diesel::{BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _, SelectableHelper as _};
2121
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
2222
use schemars::JsonSchema;
2323
use serde::Deserialize;
@@ -190,7 +190,7 @@ fn get_ls_query<'q>(
190190
.and(schema::testbed::archived.is_null())
191191
.and(schema::measure::archived.is_null()),
192192
);
193-
};
193+
}
194194

195195
match pagination_params.order() {
196196
ProjAlertsSort::Created => match pagination_params.direction {

lib/api_projects/src/benchmarks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ use bencher_schema::{
2222
schema,
2323
};
2424
use diesel::{
25-
BelongingToDsl, BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl,
26-
TextExpressionMethods,
25+
BelongingToDsl as _, BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _,
26+
TextExpressionMethods as _,
2727
};
2828
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
2929
use schemars::JsonSchema;
@@ -169,7 +169,7 @@ fn get_ls_query<'q>(
169169
query = query.filter(schema::benchmark::archived.is_not_null());
170170
} else {
171171
query = query.filter(schema::benchmark::archived.is_null());
172-
};
172+
}
173173

174174
match pagination_params.order() {
175175
ProjBenchmarksSort::Name => match pagination_params.direction {

lib/api_projects/src/branches.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use bencher_schema::{
2323
schema,
2424
};
2525
use diesel::{
26-
BelongingToDsl, BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl,
27-
TextExpressionMethods,
26+
BelongingToDsl as _, BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _,
27+
TextExpressionMethods as _,
2828
};
2929
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
3030
use schemars::JsonSchema;
@@ -178,7 +178,7 @@ fn get_ls_query<'q>(
178178
query = query.filter(schema::branch::archived.is_not_null());
179179
} else {
180180
query = query.filter(schema::branch::archived.is_null());
181-
};
181+
}
182182

183183
match pagination_params.order() {
184184
ProjBranchesSort::Name => match pagination_params.direction {

0 commit comments

Comments
 (0)