Skip to content

Commit cdbd856

Browse files
committed
chore: Update Rust to 1.91, fix new clippy complaints
1 parent 56db1ce commit cdbd856

File tree

6 files changed

+30
-32
lines changed

6 files changed

+30
-32
lines changed

mgmtd/src/bee_msg/common.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ pub(super) async fn update_node(msg: RegisterNode, app: &impl App) -> Result<Nod
4343
None
4444
};
4545

46-
if let Some(machine_uuid) = machine_uuid {
47-
if db::node::count_machines(tx, machine_uuid, node.as_ref().map(|n| n.uid))?
46+
if let Some(machine_uuid) = machine_uuid
47+
&& db::node::count_machines(tx, machine_uuid, node.as_ref().map(|n| n.uid))?
4848
>= licensed_machines
49-
{
50-
bail!("Licensed machine limit reached. Node registration denied.");
51-
}
49+
{
50+
bail!("Licensed machine limit reached. Node registration denied.");
5251
}
5352

5453
let (node, is_new) = if let Some(node) = node {

mgmtd/src/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,10 @@ generate_structs! {
429429

430430
impl Config {
431431
pub fn check_validity(&self) -> Result<()> {
432-
if let Some(ref uuid) = self.fs_uuid {
433-
if uuid.get_version_num() != 4 {
434-
bail!("Provided file system UUID is not a valid v4 UUID");
435-
}
432+
if let Some(ref uuid) = self.fs_uuid
433+
&& uuid.get_version_num() != 4
434+
{
435+
bail!("Provided file system UUID is not a valid v4 UUID");
436436
}
437437

438438
if self.quota_enforce && !self.quota_enable {

mgmtd/src/grpc/get_quota_usage.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,20 @@ pub(crate) async fn get_quota_usage(
131131

132132
// If this if the first entry, include the quota refresh period. Do not send it again
133133
// after to minimize message size.
134-
if offset == 0 {
135-
if let Some(entry) = entries.next() {
136-
stream
137-
.send(pm::GetQuotaUsageResponse {
138-
entry: Some(entry),
139-
refresh_period_s: Some(
140-
app.static_info()
141-
.user_config
142-
.quota_update_interval
143-
.as_secs(),
144-
),
145-
})
146-
.await?;
147-
}
134+
if offset == 0
135+
&& let Some(entry) = entries.next()
136+
{
137+
stream
138+
.send(pm::GetQuotaUsageResponse {
139+
entry: Some(entry),
140+
refresh_period_s: Some(
141+
app.static_info()
142+
.user_config
143+
.quota_update_interval
144+
.as_secs(),
145+
),
146+
})
147+
.await?;
148148
}
149149

150150
// Send all the (remaining) entries to the client

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.88"
2+
channel = "1.91"
33
profile = "default"

shared/src/conn/incoming.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ async fn stream_loop(
111111
.await
112112
{
113113
// If the error comes from the connection being closed, we only log a debug message
114-
if let Some(inner) = err.downcast_ref::<io::Error>() {
115-
if let ErrorKind::UnexpectedEof = inner.kind() {
116-
log::debug!("Closed stream from {:?}: {err:#}", stream.addr());
117-
return;
118-
}
114+
if let Some(inner) = err.downcast_ref::<io::Error>()
115+
&& let ErrorKind::UnexpectedEof = inner.kind()
116+
{
117+
log::debug!("Closed stream from {:?}: {err:#}", stream.addr());
118+
return;
119119
}
120120

121121
log::error!(

shared/src/nic.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ impl NicFilter {
4545
let mut split = input.split_whitespace().peekable();
4646
let mut res = Self::default();
4747

48-
if let Some(field) = split.peek() {
49-
if *field == "!" {
48+
if let Some(field) = split.peek()
49+
&& *field == "!" {
5050
res.invert = true;
5151
split.next();
5252
}
53-
}
5453

5554
if let Some(field) = split.next() && field != "*" {
5655
res.name = Some(field.to_string());

0 commit comments

Comments
 (0)