Skip to content

Commit c0f127a

Browse files
committed
chore: Update Rust to 1.90, fix clippy
1 parent 56cb7a2 commit c0f127a

File tree

6 files changed

+28
-31
lines changed

6 files changed

+28
-31
lines changed

mgmtd/src/bee_msg/node.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,11 @@ async fn update_node(msg: RegisterNode, ctx: &Context) -> Result<NodeId> {
187187
None
188188
};
189189

190-
if let Some(machine_uuid) = machine_uuid {
191-
if db::node::count_machines(tx, machine_uuid, node.as_ref().map(|n| n.uid))?
190+
if let Some(machine_uuid) = machine_uuid
191+
&& db::node::count_machines(tx, machine_uuid, node.as_ref().map(|n| n.uid))?
192192
>= licensed_machines
193-
{
194-
bail!("Licensed machine limit reached. Node registration denied.");
195-
}
193+
{
194+
bail!("Licensed machine limit reached. Node registration denied.");
196195
}
197196

198197
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/quota.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -427,17 +427,17 @@ pub(crate) async fn get_quota_usage(
427427

428428
// If this if the first entry, include the quota refresh period. Do not send it again
429429
// after to minimize message size.
430-
if offset == 0 {
431-
if let Some(entry) = entries.next() {
432-
stream
433-
.send(pm::GetQuotaUsageResponse {
434-
entry: Some(entry),
435-
refresh_period_s: Some(
436-
ctx.info.user_config.quota_update_interval.as_secs(),
437-
),
438-
})
439-
.await?;
440-
}
430+
if offset == 0
431+
&& let Some(entry) = entries.next()
432+
{
433+
stream
434+
.send(pm::GetQuotaUsageResponse {
435+
entry: Some(entry),
436+
refresh_period_s: Some(
437+
ctx.info.user_config.quota_update_interval.as_secs(),
438+
),
439+
})
440+
.await?;
441441
}
442442

443443
// 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: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ 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 == "!" {
50-
res.invert = true;
51-
split.next();
52-
}
48+
if let Some(field) = split.peek() && *field == "!" {
49+
res.invert = true;
50+
split.next();
5351
}
5452

5553
if let Some(field) = split.next() && field != "*" {

0 commit comments

Comments
 (0)