pass clippy

This commit is contained in:
Abraham Toriz 2022-05-06 22:04:36 +08:00
parent 37db75e020
commit 375d7d4e06
No known key found for this signature in database
GPG Key ID: D5B4A746DB5DD42A
4 changed files with 6 additions and 6 deletions

View File

@ -60,7 +60,7 @@ impl<'a> Command<'a> for ArchiveCommand {
};
if let Some(re) = args.grep {
entries.retain(|e| re.is_match(&e.note.clone().unwrap_or_else(String::new)));
entries.retain(|e| re.is_match(&e.note.clone().unwrap_or_default()));
}
if args.fake {

View File

@ -66,7 +66,7 @@ where
};
if let Some(re) = grep {
entries.retain(|e| re.is_match(&e.note.clone().unwrap_or_else(String::new)));
entries.retain(|e| re.is_match(&e.note.clone().unwrap_or_default()));
}
let (entries, needs_warning) = entries_or_warning(entries, &streams.db)?;

View File

@ -145,7 +145,7 @@ impl Config {
pub fn write<P: AsRef<Path>>(&self, path: P) -> Result<String> {
let path = path.as_ref();
let ext = path.extension().map(|e| e.to_str()).flatten();
let ext = path.extension().and_then(|e| e.to_str());
let output = match ext {
Some("toml") => {

View File

@ -23,9 +23,9 @@ pub fn print_formatted<W: Write>(entries: Vec<Entry>, out: &mut W, now: DateTime
writeln!(out, "BEGIN:VEVENT")?;
writeln!(out, "DESCRIPTION:{note}", note=note)?;
writeln!(out, "DTEND:{end}", end=entry.end.unwrap_or(now).format(ICAL_TIME_FORMAT).to_string())?;
writeln!(out, "DTSTAMP:{start}", start=entry.start.format(ICAL_TIME_FORMAT).to_string())?;
writeln!(out, "DTSTART:{start}", start=entry.start.format(ICAL_TIME_FORMAT).to_string())?;
writeln!(out, "DTEND:{end}", end=entry.end.unwrap_or(now).format(ICAL_TIME_FORMAT))?;
writeln!(out, "DTSTAMP:{start}", start=entry.start.format(ICAL_TIME_FORMAT))?;
writeln!(out, "DTSTART:{start}", start=entry.start.format(ICAL_TIME_FORMAT))?;
writeln!(out, "SEQUENCE:0")?;
writeln!(out, "SUMMARY:{note}", note=note)?;
writeln!(out, "UID:{uid}@{host}", uid=uid, host=host)?;