cargo clippy/fix
This commit is contained in:
@@ -3,7 +3,6 @@ use kordophone::api::http_client::HTTPAPIClient;
|
||||
use kordophone::api::http_client::Credentials;
|
||||
use kordophone::api::InMemoryTokenStore;
|
||||
|
||||
use dotenv;
|
||||
use anyhow::Result;
|
||||
use clap::Subcommand;
|
||||
use crate::printers::{ConversationPrinter, MessagePrinter};
|
||||
@@ -58,7 +57,7 @@ struct ClientCli {
|
||||
impl ClientCli {
|
||||
pub fn new() -> Self {
|
||||
let api = make_api_client_from_env();
|
||||
Self { api: api }
|
||||
Self { api }
|
||||
}
|
||||
|
||||
pub async fn print_version(&mut self) -> Result<()> {
|
||||
|
||||
@@ -140,8 +140,6 @@ impl DaemonCli {
|
||||
loop {
|
||||
self.conn.process(std::time::Duration::from_millis(1000))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn config(&mut self, cmd: ConfigCommands) -> Result<()> {
|
||||
|
||||
@@ -3,10 +3,7 @@ use clap::Subcommand;
|
||||
use kordophone::APIInterface;
|
||||
use std::{env, path::PathBuf};
|
||||
|
||||
use kordophone_db::{
|
||||
database::{Database, DatabaseAccess},
|
||||
models::{Conversation, Message},
|
||||
};
|
||||
use kordophone_db::database::{Database, DatabaseAccess};
|
||||
use crate::{client, printers::{ConversationPrinter, MessagePrinter}};
|
||||
|
||||
#[derive(Subcommand)]
|
||||
@@ -138,7 +135,7 @@ impl DbClient {
|
||||
let mut client = client::make_api_client_from_env();
|
||||
let fetched_conversations = client.get_conversations().await?;
|
||||
let db_conversations: Vec<kordophone_db::models::Conversation> = fetched_conversations.into_iter()
|
||||
.map(|c| kordophone_db::models::Conversation::from(c))
|
||||
.map(kordophone_db::models::Conversation::from)
|
||||
.collect();
|
||||
|
||||
// Process each conversation
|
||||
@@ -153,7 +150,7 @@ impl DbClient {
|
||||
// Fetch and sync messages for this conversation
|
||||
let messages = client.get_messages(&conversation_id, None, None, None).await?;
|
||||
let db_messages: Vec<kordophone_db::models::Message> = messages.into_iter()
|
||||
.map(|m| kordophone_db::models::Message::from(m))
|
||||
.map(kordophone_db::models::Message::from)
|
||||
.collect();
|
||||
|
||||
// Insert each message
|
||||
|
||||
@@ -148,7 +148,7 @@ impl<'a> ConversationPrinter<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Display for ConversationPrinter<'a> {
|
||||
impl Display for ConversationPrinter<'_> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
self.doc.render_fmt(180, f)
|
||||
}
|
||||
@@ -158,7 +158,7 @@ pub struct MessagePrinter<'a> {
|
||||
doc: RcDoc<'a, PrintableMessage>
|
||||
}
|
||||
|
||||
impl<'a> Display for MessagePrinter<'a> {
|
||||
impl Display for MessagePrinter<'_> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
self.doc.render_fmt(180, f)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user