Skip to content

Commit

Permalink
Fix new clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Nov 30, 2024
1 parent 43979bd commit e059244
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ where
#[allow(clippy::module_name_repetitions)]
pub async fn import_messages<B: Backend>(
db: &Database<B>,
config: &Option<Config>,
config: Option<&Config>,
new_messages: Vec<NewMessage>,
) -> Result<Vec<Message>> {
let messages = db
Expand Down
10 changes: 7 additions & 3 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,17 @@ async fn run<B: Backend + Send + Sync + 'static>(
content,
state: Some(cli_state),
}];
let messages = import_messages(&db, &config, raw_messages).await?;
let messages = import_messages(&db, config.as_ref(), raw_messages).await?;
print!("{}", formatter.format_messages(&messages)?);
}

Command::Import { format } => {
let messages =
import_messages(&db, &config, read_messages_stdin(stdin().lock(), format)).await?;
let messages = import_messages(
&db,
config.as_ref(),
read_messages_stdin(stdin().lock(), format),
)
.await?;
print!("{}", formatter.format_messages(&messages)?);
}

Expand Down
1 change: 1 addition & 0 deletions database/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::str::FromStr;
use std::string::ToString;

// Serialize Option<Vec<T>> into a comma-separated string so that serde_urlencoded can handle it
#[allow(clippy::ref_option)]
fn serialize_vec_to_csv<S, T>(vec: &Option<Vec<T>>, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down

0 comments on commit e059244

Please sign in to comment.