pass clippy
This commit is contained in:
parent
37db75e020
commit
375d7d4e06
|
@ -60,7 +60,7 @@ impl<'a> Command<'a> for ArchiveCommand {
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(re) = args.grep {
|
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 {
|
if args.fake {
|
||||||
|
|
|
@ -66,7 +66,7 @@ where
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(re) = grep {
|
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)?;
|
let (entries, needs_warning) = entries_or_warning(entries, &streams.db)?;
|
||||||
|
|
|
@ -145,7 +145,7 @@ impl Config {
|
||||||
|
|
||||||
pub fn write<P: AsRef<Path>>(&self, path: P) -> Result<String> {
|
pub fn write<P: AsRef<Path>>(&self, path: P) -> Result<String> {
|
||||||
let path = path.as_ref();
|
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 {
|
let output = match ext {
|
||||||
Some("toml") => {
|
Some("toml") => {
|
||||||
|
|
|
@ -23,9 +23,9 @@ pub fn print_formatted<W: Write>(entries: Vec<Entry>, out: &mut W, now: DateTime
|
||||||
|
|
||||||
writeln!(out, "BEGIN:VEVENT")?;
|
writeln!(out, "BEGIN:VEVENT")?;
|
||||||
writeln!(out, "DESCRIPTION:{note}", note=note)?;
|
writeln!(out, "DESCRIPTION:{note}", note=note)?;
|
||||||
writeln!(out, "DTEND:{end}", end=entry.end.unwrap_or(now).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).to_string())?;
|
writeln!(out, "DTSTAMP:{start}", start=entry.start.format(ICAL_TIME_FORMAT))?;
|
||||||
writeln!(out, "DTSTART:{start}", start=entry.start.format(ICAL_TIME_FORMAT).to_string())?;
|
writeln!(out, "DTSTART:{start}", start=entry.start.format(ICAL_TIME_FORMAT))?;
|
||||||
writeln!(out, "SEQUENCE:0")?;
|
writeln!(out, "SEQUENCE:0")?;
|
||||||
writeln!(out, "SUMMARY:{note}", note=note)?;
|
writeln!(out, "SUMMARY:{note}", note=note)?;
|
||||||
writeln!(out, "UID:{uid}@{host}", uid=uid, host=host)?;
|
writeln!(out, "UID:{uid}@{host}", uid=uid, host=host)?;
|
||||||
|
|
Loading…
Reference in New Issue