Skip to content

Commit 93321f6

Browse files
committed
clippy_fix
1 parent 01f54d0 commit 93321f6

File tree

112 files changed

+164
-164
lines changed

Some content is hidden

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

112 files changed

+164
-164
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ large_include_file = "warn" # Checks for the inclusion of large f
162162
little_endian_bytes = "warn" # Checks for the usage of the to_le_bytes method and/or the function from_le_bytes.
163163
lossy_float_literal = "warn" # Checks for whole number float literals that cannot be represented as the underlying type without loss.
164164
map_err_ignore = "warn" # Checks for instances of map_err(|_| Some::Enum)
165-
map_with_unused_argument_over_range = "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.
165+
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.
166166
mem_forget = "warn" # Checks for usage of std::mem::forget(t) where t is Drop or has a field that implements Drop.
167167
missing_assert_message = "warn" # Checks assertions without a custom panic message.
168168
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.

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 {

lib/api_projects/src/measures.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use bencher_schema::{
2121
schema,
2222
};
2323
use diesel::{
24-
BelongingToDsl, BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl,
25-
TextExpressionMethods,
24+
BelongingToDsl as _, BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _,
25+
TextExpressionMethods as _,
2626
};
2727
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
2828
use schemars::JsonSchema;
@@ -168,7 +168,7 @@ fn get_ls_query<'q>(
168168
query = query.filter(schema::measure::archived.is_not_null());
169169
} else {
170170
query = query.filter(schema::measure::archived.is_null());
171-
};
171+
}
172172

173173
match pagination_params.order() {
174174
ProjMeasuresSort::Name => match pagination_params.direction {

lib/api_projects/src/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use bencher_schema::{
2323
schema, view,
2424
};
2525
use diesel::{
26-
ExpressionMethods, JoinOnDsl, NullableExpressionMethods, QueryDsl, RunQueryDsl,
27-
SelectableHelper,
26+
ExpressionMethods as _, JoinOnDsl as _, NullableExpressionMethods as _, QueryDsl as _, RunQueryDsl as _,
27+
SelectableHelper as _,
2828
};
2929
use dropshot::{endpoint, HttpError, Path, RequestContext};
3030
use schemars::JsonSchema;

lib/api_projects/src/perf/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ use bencher_schema::{
3131
schema, view,
3232
};
3333
use diesel::{
34-
ExpressionMethods, JoinOnDsl, NullableExpressionMethods, QueryDsl, RunQueryDsl,
35-
SelectableHelper,
34+
ExpressionMethods as _, JoinOnDsl as _, NullableExpressionMethods as _, QueryDsl as _, RunQueryDsl as _,
35+
SelectableHelper as _,
3636
};
3737
use dropshot::{endpoint, HttpError, Path, Query, RequestContext};
3838
use schemars::JsonSchema;

lib/api_projects/src/plots.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use bencher_schema::{
2121
schema,
2222
};
2323
use diesel::{
24-
BelongingToDsl, BoolExpressionMethods, ExpressionMethods, NullableExpressionMethods, QueryDsl,
25-
RunQueryDsl, TextExpressionMethods,
24+
BelongingToDsl as _, BoolExpressionMethods as _, ExpressionMethods as _, NullableExpressionMethods as _, QueryDsl as _,
25+
RunQueryDsl as _, TextExpressionMethods as _,
2626
};
2727
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
2828
use schemars::JsonSchema;

lib/api_projects/src/projects.rs

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

lib/api_projects/src/reports.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ use bencher_schema::{
3030
schema,
3131
};
3232
use diesel::{
33-
dsl::count, BelongingToDsl, BoolExpressionMethods, ExpressionMethods, JoinOnDsl, QueryDsl,
34-
RunQueryDsl, SelectableHelper,
33+
dsl::count, BelongingToDsl as _, BoolExpressionMethods as _, ExpressionMethods as _, JoinOnDsl as _, QueryDsl as _,
34+
RunQueryDsl as _, SelectableHelper as _,
3535
};
3636
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
3737
use schemars::JsonSchema;
@@ -200,7 +200,7 @@ fn get_ls_query<'q>(
200200
.is_null()
201201
.and(schema::testbed::archived.is_null()),
202202
);
203-
};
203+
}
204204

205205
Ok(match pagination_params.order() {
206206
ProjReportsSort::DateTime => match pagination_params.direction {

lib/api_projects/src/testbeds.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use bencher_schema::{
2121
schema,
2222
};
2323
use diesel::{
24-
BelongingToDsl, BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl,
25-
TextExpressionMethods,
24+
BelongingToDsl as _, BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _,
25+
TextExpressionMethods as _,
2626
};
2727
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
2828
use schemars::JsonSchema;
@@ -168,7 +168,7 @@ fn get_ls_query<'q>(
168168
query = query.filter(schema::testbed::archived.is_not_null());
169169
} else {
170170
query = query.filter(schema::testbed::archived.is_null());
171-
};
171+
}
172172

173173
match pagination_params.order() {
174174
ProjTestbedsSort::Name => match pagination_params.direction {

lib/api_projects/src/thresholds.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ use bencher_schema::{
3030
schema,
3131
};
3232
use diesel::{
33-
BelongingToDsl, BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl,
34-
SelectableHelper,
33+
BelongingToDsl as _, BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _,
34+
SelectableHelper as _,
3535
};
3636
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
3737
use schemars::JsonSchema;
@@ -195,7 +195,7 @@ fn get_ls_query<'q>(
195195
.and(schema::testbed::archived.is_null())
196196
.and(schema::measure::archived.is_null()),
197197
);
198-
};
198+
}
199199

200200
Ok(match pagination_params.order() {
201201
ProjThresholdsSort::Created => match pagination_params.direction {

lib/api_server/src/backup.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ use bencher_schema::{
1212
model::user::{admin::AdminUser, auth::BearerToken},
1313
};
1414
use chrono::Utc;
15-
use diesel::connection::SimpleConnection;
15+
use diesel::connection::SimpleConnection as _;
1616
use dropshot::{endpoint, HttpError, RequestContext, TypedBody};
1717
use tokio::{
1818
fs::remove_file,
19-
io::{AsyncReadExt, AsyncWriteExt, BufReader, BufWriter},
19+
io::{AsyncReadExt as _, AsyncWriteExt as _, BufReader, BufWriter},
2020
};
2121

2222
const BUFFER_SIZE: usize = 1024;
@@ -111,7 +111,7 @@ async fn backup(
111111
.map_err(BackupError::DataStore)?;
112112
} else {
113113
return Err(BackupError::NoDataStore);
114-
};
114+
}
115115
}
116116

117117
// Remove the remaining database backup

lib/api_users/src/tokens.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_users/src/users.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bencher_endpoint::{CorsResponse, Endpoint, Get, Patch, ResponseOk, TotalCount};
22
use bencher_json::{
3-
user::JsonUsers, JsonDirection, JsonPagination, JsonUpdateUser, JsonUser, ResourceId, Sanitize,
3+
user::JsonUsers, JsonDirection, JsonPagination, JsonUpdateUser, JsonUser, ResourceId, Sanitize as _,
44
Search, UserName,
55
};
66
use bencher_schema::{
@@ -15,7 +15,7 @@ use bencher_schema::{
1515
schema,
1616
};
1717
use diesel::{
18-
BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl, TextExpressionMethods,
18+
BoolExpressionMethods as _, ExpressionMethods as _, QueryDsl as _, RunQueryDsl as _, TextExpressionMethods as _,
1919
};
2020
use dropshot::{endpoint, HttpError, Path, Query, RequestContext, TypedBody};
2121
use schemars::JsonSchema;

lib/bencher_adapter/benches/adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use criterion::{Criterion, criterion_group, criterion_main};
44

5-
use bencher_adapter::{Adaptable, Settings};
5+
use bencher_adapter::{Adaptable as _, Settings};
66
use bencher_json::project::report::Adapter;
77

88
const JSON_RESULT: &str = r#"{

lib/bencher_adapter/src/adapters/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub(crate) mod test_util {
2727
use bencher_json::project::{
2828
measure::built_in::{
2929
default::{Latency, Throughput},
30-
BuiltInMeasure,
30+
BuiltInMeasure as _,
3131
},
3232
report::JsonAverage,
3333
};

lib/bencher_adapter/src/adapters/rust/criterion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub(crate) mod test_rust_criterion {
107107

108108
use crate::{
109109
adapters::test_util::{convert_file_path, opt_convert_file_path, validate_latency},
110-
Adaptable, AdapterResults, Settings,
110+
Adaptable as _, AdapterResults, Settings,
111111
};
112112

113113
use super::{parse_criterion, AdapterRustCriterion};

lib/bencher_adapter/src/adapters/rust/iai.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use bencher_json::{
22
project::{
33
measure::built_in::{
44
iai::{EstimatedCycles, Instructions, L1Accesses, L2Accesses, RamAccesses},
5-
BuiltInMeasure,
5+
BuiltInMeasure as _,
66
},
77
report::JsonAverage,
88
},
@@ -142,12 +142,12 @@ pub(crate) mod test_rust_iai {
142142

143143
use crate::{
144144
adapters::test_util::convert_file_path, results::adapter_metrics::AdapterMetrics,
145-
Adaptable, AdapterResults,
145+
Adaptable as _, AdapterResults,
146146
};
147147
use bencher_json::{
148148
project::measure::built_in::{
149149
iai::{EstimatedCycles, Instructions, L1Accesses, L2Accesses, RamAccesses},
150-
BuiltInMeasure,
150+
BuiltInMeasure as _,
151151
},
152152
JsonNewMetric,
153153
};

lib/bencher_adapter/src/adapters/rust/iai_callgrind.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bencher_json::{
22
project::{
3-
measure::built_in::{iai_callgrind, BuiltInMeasure},
3+
measure::built_in::{iai_callgrind, BuiltInMeasure as _},
44
report::JsonAverage,
55
},
66
BenchmarkName, JsonNewMetric,
@@ -30,7 +30,7 @@ impl Adaptable for AdapterRustIaiCallgrind {
3030
Some(JsonAverage::Mean | JsonAverage::Median) => {
3131
return None; // 'iai_callgrind' results are for a single run only.
3232
},
33-
};
33+
}
3434

3535
// Clean up the input by removing ANSI escape codes:
3636
let input = strip_ansi_escapes::strip_str(input);
@@ -235,7 +235,7 @@ fn not_line_ending<'a>() -> impl FnMut(&'a str) -> IResult<&'a str, &'a str> {
235235
#[cfg(test)]
236236
pub(crate) mod test_rust_iai_callgrind {
237237
use crate::{adapters::test_util::convert_file_path, AdapterResults};
238-
use bencher_json::project::measure::built_in::{iai_callgrind, BuiltInMeasure};
238+
use bencher_json::project::measure::built_in::{iai_callgrind, BuiltInMeasure as _};
239239
use ordered_float::OrderedFloat;
240240
use pretty_assertions::assert_eq;
241241

lib/bencher_adapter/src/adapters/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use nom::{
1111
IResult,
1212
};
1313
use ordered_float::OrderedFloat;
14-
use rust_decimal::prelude::ToPrimitive;
14+
use rust_decimal::prelude::ToPrimitive as _;
1515
use rust_decimal::Decimal;
1616
use serde::{
1717
de::{self, Visitor},

lib/bencher_adapter/src/results/adapter_metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::HashMap, str::FromStr};
1+
use std::{collections::HashMap, str::FromStr as _};
22

33
use bencher_json::{JsonNewMetric, MeasureNameId};
44
use serde::{Deserialize, Serialize};

lib/bencher_adapter/src/results/adapter_results.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use std::{collections::HashMap, str::FromStr};
1+
use std::{collections::HashMap, str::FromStr as _};
22

33
use bencher_json::{
44
project::{
5-
measure::built_in::{self, BuiltInMeasure},
5+
measure::built_in::{self, BuiltInMeasure as _},
66
metric::Mean,
77
},
88
BenchmarkName, JsonNewMetric,

0 commit comments

Comments
 (0)