crier

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs

commit e3a598dda667bb2c0580c54c11139786981e7f17
parent a7cbc9ca91b7b5b064f0b4ace07fdb4ae61d9de1
Author: lash <dev@holbrook.no>
Date:   Fri,  5 Jul 2024 14:28:56 +0100

Eliminate warnings, remove unused syms

Diffstat:
Msrc/io/fs.rs | 8++++----
Msrc/lib.rs | 14++++++--------
Msrc/mem.rs | 5++---
Msrc/tests.rs | 2--
4 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/src/io/fs.rs b/src/io/fs.rs @@ -3,16 +3,16 @@ use super::FeedGet; use feed_rs::model::Feed; use feed_rs::parser; //use http::Uri; -use std::path::Path; +//use std::path::Path; use std::fs::File; -use core::str::FromStr; -use std::io::stderr; +//use core::str::FromStr; +//use std::io::stderr; pub struct Fs { } impl FeedGet for Fs { - fn get(&self, s: &str, method: Option<FeedMethod>) -> Result<Feed, u64> { + fn get(&self, s: &str, _method: Option<FeedMethod>) -> Result<Feed, u64> { //let uri = Uri::from_str(s).unwrap(); let f = File::open(s).unwrap(); let feed = parser::parse(f).unwrap(); diff --git a/src/lib.rs b/src/lib.rs @@ -3,12 +3,12 @@ use std::hash::Hasher; use std::hash::Hash; use std::iter::Iterator; use std::io::Write; -use std::error::Error as StdError; +//use std::error::Error as StdError; use feed_rs::model::Entry; use feed_rs::model::Feed; use rs_sha512::Sha512Hasher; -use chrono::DateTime; +//use chrono::DateTime; use chrono::Local; use atom_syndication::Feed as OutFeed; @@ -16,7 +16,7 @@ mod meta; mod io; mod mem; use meta::FeedMetadata; -use mem::MemCache; +//use mem::MemCache; use mem::CacheWriter; use mem::Cache; @@ -65,15 +65,13 @@ impl<'a> Sequencer<'a> { } pub fn add(&mut self, entry: Entry) -> bool { - let have_closer: bool; - let mut w: &mut dyn Write; + let w: &mut dyn Write; let mut id: String; id = entry.id.to_string(); match &mut self.cache { Some(v) => { w = v.open(id); - have_closer = true; }, None => { w = &mut self.default_cache; @@ -114,7 +112,7 @@ impl<'a> Sequencer<'a> { feed.set_updated(Local::now().to_utc()); match self.metadata.apply(&mut feed) { - Err(v) => { + Err(_v) => { return Err(Error::WriteError); }, Ok(_) => { @@ -123,7 +121,7 @@ impl<'a> Sequencer<'a> { } match feed.write_to(w) { - Err(v) => { + Err(_v) => { return Err(Error::WriteError); }, Ok(_) => { diff --git a/src/mem.rs b/src/mem.rs @@ -45,8 +45,7 @@ impl MemCache { impl Cache for MemCache { fn open(&mut self, id: String) -> &mut dyn Write { - let mut w: CacheWriter; - let mut r: Option<&CacheWriter>; + let w: CacheWriter; if !self.files.contains_key(&id) { w = CacheWriter::new(); self.files.insert(id.clone(), w); @@ -54,7 +53,7 @@ impl Cache for MemCache { self.files.get_mut(&id).unwrap() } - fn close(&mut self, id: String) -> usize { + fn close(&mut self, _id: String) -> usize { return 0; } } diff --git a/src/tests.rs b/src/tests.rs @@ -1,6 +1,4 @@ use std::clone::Clone; -use std::fs::Metadata; -use std::fs::metadata; use std::fs::File; use feed_rs::model::Entry;