rust: 1.95 → 1.97.1

The update to `flake.lock` is a simple

    nix flake update rust-overlay

to be able to reach 1.97.1.

The changes to `**/*.rs` files are improvements suggested by Clippy.
This commit is contained in:
Lorenz Leutgeb
2026-07-17 10:29:56 +02:00
committed by Fintan Halpenny
parent 6d846d754d
commit f31fbf40ce
11 changed files with 36 additions and 39 deletions
+2 -2
View File
@@ -70,7 +70,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
}
Identity => anyhow::bail!(
"Creation of collaborative objects of type {} is not supported.",
&type_name
type_name
),
Other(type_name) => {
let mut store: Store<cob::external::External, _, _> =
@@ -195,7 +195,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
}
Identity => anyhow::bail!(
"Update of collaborative objects of type {} is not supported.",
&type_name
type_name
),
Other(type_name) => {
use cob::external::{Action, External};
+2 -2
View File
@@ -168,7 +168,7 @@ impl Runtime {
Err(e) => return Err(e.into()),
}
log::info!(target: "node", "Default seeding policy set to '{}'", &policy);
log::info!(target: "node", "Default seeding policy set to '{}'", policy);
log::info!(target: "node", "Initializing service ({network:?})..");
let announcement = service::gossip::node(&config, timestamp)
@@ -360,7 +360,7 @@ impl Runtime {
}
}
log::info!(target: "node", "Binding control socket {}..", &path.display());
log::info!(target: "node", "Binding control socket {}..", path.display());
match UnixListener::bind(&path) {
Ok(sock) => Ok(ControlSocket::Bound(sock, path)),
Err(err) if err.kind() == io::ErrorKind::AddrInUse => Err(Error::AlreadyRunning(path)),
+1 -1
View File
@@ -2530,7 +2530,7 @@ where
/// Run idle task for all connections.
fn idle_connections(&mut self) {
for (_, sess) in self.sessions.iter_mut() {
for sess in self.sessions.values_mut() {
sess.idle(self.clock);
if sess.is_stable() {
+1 -1
View File
@@ -68,7 +68,7 @@ impl Outbox {
_ => log::Level::Debug,
};
msg.log(level, &remote.id, Link::Outbound);
trace!(target: "service", "Write {:?} to {}", &msg, remote);
trace!(target: "service", "Write {:?} to {}", msg, remote);
self.io.push_back(Io::Write(remote.id, vec![msg]));
}
@@ -107,14 +107,11 @@ impl NodeAnnouncement {
/// is returned.
pub fn solve(mut self, target: u32) -> Option<Self> {
loop {
if let Some(nonce) = self.nonce.checked_add(1) {
self.nonce = nonce;
let nonce = self.nonce.checked_add(1)?;
self.nonce = nonce;
if self.work() >= target {
break;
}
} else {
return None;
if self.work() >= target {
break;
}
}
Some(self)
+1 -4
View File
@@ -202,10 +202,7 @@ impl SymbolicRefs {
loop {
match current {
Target::Direct(q) => return Some(q.as_ref()),
Target::Symbolic(s) => match self.0.get(s.as_ref()) {
Some(next) => current = next,
None => return None,
},
Target::Symbolic(s) => current = self.0.get(s.as_ref())?,
}
}
}
+19 -13
View File
@@ -818,10 +818,12 @@ impl Doc {
(Some(ref default_branch), Ok(project)) => {
let project_branch = project.default_branch_qualified();
if project_branch != *default_branch {
return Err(DefaultBranchRuleError::HeadMismatch {
cref: default_branch.to_ref_string(),
project: project_branch.to_ref_string(),
})?;
return Err(CanonicalRefsError::DefaultBranchRuleError(
DefaultBranchRuleError::HeadMismatch {
cref: default_branch.to_ref_string(),
project: project_branch.to_ref_string(),
},
));
}
self.validate_head_rule(&raw_crefs, default_branch)?;
}
@@ -855,19 +857,23 @@ impl Doc {
let allowed = rule.allowed();
if *allowed != rules::Allowed::Delegates {
return Err(DefaultBranchRuleError::Allowed {
pattern: pattern.to_string(),
actual: allowed.to_string(),
})?;
return Err(CanonicalRefsError::DefaultBranchRuleError(
DefaultBranchRuleError::Allowed {
pattern: pattern.to_string(),
actual: allowed.to_string(),
},
));
}
let actual = *rule.threshold();
let expected = self.threshold();
if actual != expected {
return Err(DefaultBranchRuleError::Threshold {
pattern: pattern.to_string(),
actual,
expected,
})?;
return Err(CanonicalRefsError::DefaultBranchRuleError(
DefaultBranchRuleError::Threshold {
pattern: pattern.to_string(),
actual,
expected,
},
));
}
Ok(())
}
+1 -4
View File
@@ -216,10 +216,7 @@ pub fn verify(raw: RawDoc) -> Result<Doc, error::DocVerification> {
// 2. … symbolic reference with the name `HEAD`.
// (This reference must be synthesized!)
use super::GetRawCanonicalRefs as _;
match raw
.raw_canonical_refs()
.map(|rcrefs| rcrefs.and_then(|c| project.map(|p| (c, p))))
{
match raw.raw_canonical_refs().map(|rcrefs| rcrefs.zip(project)) {
Ok(Some((crefs, project))) => {
let default =
git::fmt::Qualified::from(git::fmt::lit::refs_heads(project.default_branch()));
+1 -1
View File
@@ -988,7 +988,7 @@ impl WriteRepository for Repository {
if old == Some(new) {
return Ok(SetHead { old, new });
}
log::debug!(target: "storage", "Setting ref: {} -> {}", &branch_ref, new);
log::debug!(target: "storage", "Setting ref: {} -> {}", branch_ref, new);
self.raw()
.reference(&branch_ref, new.into(), true, "set-local-branch (radicle)")?;
Generated
+3 -3
View File
@@ -161,11 +161,11 @@
]
},
"locked": {
"lastModified": 1778210054,
"narHash": "sha256-iYINsX0BVDxTXd0z4FzDpBYHZ9fWUtwjG9cKSXwe9Tg=",
"lastModified": 1784216271,
"narHash": "sha256-bvaxxdk7mmMQ88AuXQGTUtk+PcUujHpgxqpryqTWvTU=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "bc83d66023d19fb301ee98772643b24b6129ef48",
"rev": "1f69c7203034a4a974d7a4eac0f19b54af30804d",
"type": "github"
},
"original": {
+1 -1
View File
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.95"
channel = "1.97.1"
profile = "default"
components = [ "rust-src" ]