Run clippy fix
This commit is contained in:
@@ -84,13 +84,11 @@ impl InsightGenerator {
|
||||
let components: Vec<_> = path.components().collect();
|
||||
|
||||
// If path has at least 2 components (directory + file), extract first directory
|
||||
if components.len() >= 2 {
|
||||
if let Some(component) = components.first() {
|
||||
if let Some(os_str) = component.as_os_str().to_str() {
|
||||
if components.len() >= 2
|
||||
&& let Some(component) = components.first()
|
||||
&& let Some(os_str) = component.as_os_str().to_str() {
|
||||
return Some(os_str.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
@@ -191,8 +189,8 @@ impl InsightGenerator {
|
||||
.into_iter()
|
||||
.filter(|msg| {
|
||||
// Extract date from formatted daily summary "[2024-08-15] Contact ..."
|
||||
if let Some(bracket_end) = msg.find(']') {
|
||||
if let Some(date_str) = msg.get(1..bracket_end) {
|
||||
if let Some(bracket_end) = msg.find(']')
|
||||
&& let Some(date_str) = msg.get(1..bracket_end) {
|
||||
// Parse just the date (daily summaries don't have time)
|
||||
if let Ok(msg_date) =
|
||||
chrono::NaiveDate::parse_from_str(date_str, "%Y-%m-%d")
|
||||
@@ -206,7 +204,6 @@ impl InsightGenerator {
|
||||
return time_diff > exclusion_window;
|
||||
}
|
||||
}
|
||||
}
|
||||
false
|
||||
})
|
||||
.take(limit)
|
||||
@@ -521,7 +518,7 @@ impl InsightGenerator {
|
||||
"searches about {} {} {}",
|
||||
DateTime::from_timestamp(timestamp, 0)
|
||||
.map(|dt| dt.format("%B %Y").to_string())
|
||||
.unwrap_or_else(|| "".to_string()),
|
||||
.unwrap_or_default(),
|
||||
location.unwrap_or(""),
|
||||
contact
|
||||
.map(|c| format!("involving {}", c))
|
||||
|
||||
Reference in New Issue
Block a user