Skip to content

Commit d567760

Browse files
chore: update pinned rust version, clippy lints, remove some dead code (#1444)
1 parent c752aff commit d567760

File tree

130 files changed

+810
-261
lines changed

Some content is hidden

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

130 files changed

+810
-261
lines changed

.cargo/config.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[build]
22
rustflags = [
33
"-Zproc-macro-backtrace",
4-
"-Wunused_qualifications",
5-
"-Wclippy::upper_case_acronyms",
64
# Flag to make build.rs scripts generate docs. Should only be used in this repository
75
# internally, not by dependants.
86
'--cfg=HYDROFLOW_GENERATE_DOCS',

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,13 @@ debug-assertions = false
5353

5454
[profile.release.package.website_playground]
5555
opt-level = "s"
56+
57+
[workspace.lints.rust]
58+
unused_qualifications = "warn"
59+
60+
[workspace.lints.clippy]
61+
allow_attributes = "warn"
62+
allow_attributes_without_reason = "warn"
63+
explicit_into_iter_loop = "warn"
64+
let_and_return = "allow"
65+
upper_case_acronyms = "warn"

benches/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ version = "0.0.0"
55
edition = "2021"
66
license = "Apache-2.0"
77

8+
[lints]
9+
workspace = true
10+
811
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
912

1013
[dependencies]

benches/benches/fork_join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn benchmark_hydroflow(c: &mut Criterion) {
3434
send1,
3535
send2,
3636
|_ctx, recv, send1, send2| {
37-
for v in recv.take_inner().into_iter() {
37+
for v in recv.take_inner() {
3838
if v % 2 == 0 {
3939
send1.give(Some(v));
4040
} else {

benches/benches/micro_ops.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ fn ops(c: &mut Criterion) {
185185
let dist = Uniform::new(0, 100);
186186
let input0: Vec<usize> = (0..NUM_INTS).map(|_| dist.sample(&mut rng)).collect();
187187

188-
#[allow(clippy::unnecessary_fold)]
189188
{
190189
hydroflow_syntax! {
191190
source_iter(black_box(input0)) -> fold::<'tick>(|| 0, |accum: &mut _, elem| { *accum += elem }) -> for_each(|x| { black_box(x); });

benches/benches/reachability.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ fn benchmark_hydroflow(c: &mut Criterion) {
289289
});
290290
}
291291

292-
#[allow(clippy::map_clone)]
293292
fn benchmark_hydroflow_surface_cheating(c: &mut Criterion) {
294293
c.bench_function("reachability/hydroflow/surface_cheating", |b| {
295294
b.iter_batched(

hydro_deploy/core/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ license = "Apache-2.0"
77
documentation = "https://docs.rs/hydro_deploy/"
88
description = "Hydro Deploy"
99

10+
[lints]
11+
workspace = true
12+
1013
[dependencies]
1114
anyhow = { version = "1.0.82", features = [ "backtrace" ] }
1215
async-process = "2.0.0"
@@ -34,3 +37,4 @@ tempfile = "3.0.0"
3437
tokio = { version = "1.29.0", features = [ "full" ] }
3538
tokio-stream = { version = "0.1.3", default-features = false }
3639
tokio-util = { version = "0.7.5", features = [ "compat", "io-util" ] }
40+

hydro_deploy/core/src/deployment.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ impl Deployment {
4545
ret
4646
}
4747

48-
#[allow(non_snake_case)]
48+
#[expect(non_snake_case, reason = "constructor-esque")]
4949
pub fn Localhost(&self) -> Arc<LocalhostHost> {
5050
self.localhost_host.clone().unwrap()
5151
}
5252

53-
#[allow(non_snake_case)]
53+
#[expect(non_snake_case, reason = "constructor-esque")]
5454
pub fn CustomService(
5555
&mut self,
5656
on: Arc<dyn Host>,
@@ -201,7 +201,6 @@ impl Deployment {
201201
/// Buildstructor methods.
202202
#[buildstructor::buildstructor]
203203
impl Deployment {
204-
#[allow(clippy::too_many_arguments)]
205204
#[builder(entry = "GcpComputeEngineHost", exit = "add")]
206205
pub fn add_gcp_compute_engine_host(
207206
&mut self,
@@ -227,7 +226,6 @@ impl Deployment {
227226
})
228227
}
229228

230-
#[allow(clippy::too_many_arguments)]
231229
#[builder(entry = "AzureHost", exit = "add")]
232230
pub fn add_azure_host(
233231
&mut self,

hydro_deploy/core/src/gcp.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ pub struct GcpComputeEngineHost {
184184
}
185185

186186
impl GcpComputeEngineHost {
187-
#[allow(clippy::too_many_arguments)] // TODO(mingwei)
187+
#[expect(
188+
clippy::too_many_arguments,
189+
reason = "internal code called by builder elsewhere"
190+
)]
188191
pub fn new(
189192
id: usize,
190193
project: impl Into<String>,

hydro_deploy/core/src/hydroflow_crate/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct BuildParams {
3535
}
3636
impl BuildParams {
3737
/// Creates a new `BuildParams` and canonicalizes the `src` path.
38-
#[allow(clippy::too_many_arguments)]
38+
#[expect(clippy::too_many_arguments, reason = "internal code")]
3939
pub fn new(
4040
src: impl AsRef<Path>,
4141
bin: Option<String>,

0 commit comments

Comments
 (0)