fix(clippy): resolve lints for Rust 1.96 (io_other_error, derivable_impls, manual_contains, unnecessary_sort_by, while_let_loop)
CI / cargo fmt --check (push) Successful in 23s
CI / cargo clippy (push) Successful in 32s
CI / cargo test (push) Successful in 44s

This commit is contained in:
gffranco
2026-06-24 01:01:51 +00:00
parent 96970405a0
commit 22a6bcb815
13 changed files with 25 additions and 46 deletions
+5 -11
View File
@@ -3762,17 +3762,11 @@ pub mod export_ops {
.arg("-c")
.arg(&cmd)
.status()
.map_err(|e| {
std::io::Error::new(
std::io::ErrorKind::Other,
format!("custom_wiki2html spawn failed: {e}"),
)
})?;
.map_err(|e| std::io::Error::other(format!("custom_wiki2html spawn failed: {e}")))?;
if !status.success() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!("custom_wiki2html exited with {status}"),
));
return Err(std::io::Error::other(format!(
"custom_wiki2html exited with {status}"
)));
}
Ok(PageExport {
page: name.to_string(),
@@ -3821,7 +3815,7 @@ pub mod export_ops {
/// rendered-HTML body per entry.
pub fn write_rss(cfg: &WikiConfig, entries: &[DiaryEntry]) -> std::io::Result<PathBuf> {
let mut sorted: Vec<&DiaryEntry> = entries.iter().collect();
sorted.sort_by(|a, b| b.date.cmp(&a.date));
sorted.sort_by_key(|a| std::cmp::Reverse(a.date));
let cap = if cfg.html.rss_max_items == 0 {
usize::MAX
} else {
+1 -1
View File
@@ -47,7 +47,7 @@ pub fn list_entries(index: &WorkspaceIndex) -> Vec<DiaryEntry> {
})
})
.collect();
out.sort_by(|a, b| a.date.cmp(&b.date));
out.sort_by_key(|a| a.date);
out
}
+1 -1
View File
@@ -406,7 +406,7 @@ impl LanguageServer for Backend {
.general
.as_ref()
.and_then(|g| g.position_encodings.as_ref())
.map(|encs| encs.iter().any(|e| *e == PositionEncodingKind::UTF8))
.map(|encs| encs.contains(&PositionEncodingKind::UTF8))
.unwrap_or(false);
self.use_utf8.store(supports_utf8, Ordering::Relaxed);