From 0bed9fa3035dddc974cefc9875f5a24b4e2f83f4 Mon Sep 17 00:00:00 2001 From: bdbch Date: Fri, 22 May 2026 22:42:52 +0200 Subject: [PATCH] fix: remove dead code and clippy warnings --- src/config.rs | 6 +++--- src/release_file.rs | 19 ------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/config.rs b/src/config.rs index 1e9f46f..bb95a26 100644 --- a/src/config.rs +++ b/src/config.rs @@ -230,9 +230,9 @@ impl OxrlsConfig { let base = config_path.parent().unwrap_or_else(|| Path::new(".")); // If the config's parent directory already has the release_dir name, or if // the release_dir is ".", use the parent directly. - if self.release_dir == "." || self.release_dir.is_empty() { - base.to_path_buf() - } else if base.file_name().and_then(|n| n.to_str()) == Some(self.release_dir.as_str()) { + if self.release_dir == "." || self.release_dir.is_empty() + || base.file_name().and_then(|n| n.to_str()) == Some(self.release_dir.as_str()) + { base.to_path_buf() } else { base.join(&self.release_dir) diff --git a/src/release_file.rs b/src/release_file.rs index 84c767f..ce7f9e1 100644 --- a/src/release_file.rs +++ b/src/release_file.rs @@ -349,25 +349,6 @@ pub fn strip_stable_entries(path: &Path, _is_pre_release: impl Fn(&str) -> bool) consume_release_file(path) } -/// Write a release file with filtered entries while preserving the original file path. -fn write_filtered_release_file( - path: &Path, - releases: &IndexMap, - summary: &str, -) -> Result<()> { - let mut yaml_lines = String::new(); - for (pkg, bump) in releases { - yaml_lines.push_str(&format!( - "\"{}\": {}\n", - pkg, - serde_json::to_string(&bump).unwrap_or_else(|_| "patch".to_string()) - )); - } - let content = format!("---\n{}---\n\n{}", yaml_lines, summary); - std::fs::write(path, content).map_err(OxrlsError::Io)?; - Ok(()) -} - #[cfg(test)] mod tests { use super::*; -- 2.51.2