Skip to content

Commit 5619601

Browse files
committed
clippy
1 parent 28a4c19 commit 5619601

File tree

2 files changed

+15
-40
lines changed

2 files changed

+15
-40
lines changed

src/context.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,28 @@ use ratelimit::Ratelimit;
1515
use serde::Serialize;
1616
use tokio::sync::{Mutex, Notify, RwLock};
1717

18-
use crate::chat::{self, get_chat_cnt, ChatId, ChatVisibility, MuteDuration, ProtectionStatus};
18+
use crate::chat::{get_chat_cnt, ChatId};
1919
use crate::chatlist_events;
2020
use crate::config::Config;
2121
use crate::constants::{
22-
self, DC_BACKGROUND_FETCH_QUOTA_CHECK_RATELIMIT, DC_CHAT_ID_TRASH, DC_VERSION_STR,
22+
self, DC_BACKGROUND_FETCH_QUOTA_CHECK_RATELIMIT, DC_VERSION_STR,
2323
};
24-
use crate::contact::{import_vcard, mark_contact_id_as_verified, Contact, ContactId};
24+
use crate::contact::{Contact, ContactId};
2525
use crate::debug_logging::DebugLogging;
26-
use crate::download::DownloadState;
2726
use crate::events::{Event, EventEmitter, EventType, Events};
2827
use crate::imap::{FolderMeaning, Imap, ServerMetadata};
29-
use crate::key::{load_self_public_key, load_self_secret_key, self_fingerprint, DcKey as _};
28+
use crate::key::{self_fingerprint, DcKey as _};
3029
use crate::log::LogExt;
3130
use crate::login_param::{ConfiguredLoginParam, EnteredLoginParam};
32-
use crate::message::{self, Message, MessageState, MsgId, Viewtype};
33-
use crate::param::{Param, Params};
31+
use crate::message::{self, MessageState, MsgId};
3432
use crate::peer_channels::Iroh;
3533
use crate::push::PushSubscriber;
3634
use crate::quota::QuotaInfo;
3735
use crate::scheduler::{convert_folder_meaning, SchedulerState};
3836
use crate::sql::Sql;
3937
use crate::stock_str::StockStrings;
4038
use crate::timesmearing::SmearedTimestamp;
41-
use crate::tools::{self, create_id, duration_to_str, time, time_elapsed};
39+
use crate::tools::{self, duration_to_str, time, time_elapsed};
4240

4341
/// Builder for the [`Context`].
4442
///

src/self_reporting.rs

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,21 @@
11
//! TODO doc comment
22
3-
use std::collections::{BTreeMap, HashMap};
4-
use std::ffi::OsString;
5-
use std::ops::Deref;
6-
use std::path::{Path, PathBuf};
7-
use std::sync::atomic::{AtomicBool, Ordering};
8-
use std::sync::{Arc, OnceLock};
9-
use std::time::Duration;
103

11-
use anyhow::{bail, ensure, Context as _, Result};
12-
use async_channel::{self as channel, Receiver, Sender};
4+
use anyhow::{Context as _, Result};
135
use pgp::types::PublicKeyTrait;
14-
use ratelimit::Ratelimit;
156
use serde::Serialize;
16-
use tokio::sync::{Mutex, Notify, RwLock};
177

18-
use crate::chat::{self, get_chat_cnt, ChatId, ChatVisibility, MuteDuration, ProtectionStatus};
19-
use crate::chatlist_events;
8+
use crate::chat::{self, ChatId, ChatVisibility, MuteDuration, ProtectionStatus};
209
use crate::config::Config;
21-
use crate::constants::{
22-
self, DC_BACKGROUND_FETCH_QUOTA_CHECK_RATELIMIT, DC_CHAT_ID_TRASH, DC_VERSION_STR,
23-
};
24-
use crate::contact::{import_vcard, mark_contact_id_as_verified, Contact, ContactId};
10+
use crate::constants::DC_CHAT_ID_TRASH;
11+
use crate::contact::{import_vcard, mark_contact_id_as_verified, ContactId};
2512
use crate::context::{get_version_str, Context};
26-
use crate::debug_logging::DebugLogging;
2713
use crate::download::DownloadState;
28-
use crate::events::{Event, EventEmitter, EventType, Events};
29-
use crate::imap::{FolderMeaning, Imap, ServerMetadata};
30-
use crate::key::{load_self_public_key, load_self_secret_key, DcKey as _};
14+
use crate::key::load_self_public_key;
3115
use crate::log::LogExt;
32-
use crate::login_param::{ConfiguredLoginParam, EnteredLoginParam};
33-
use crate::message::{self, Message, MessageState, MsgId, Viewtype};
16+
use crate::message::{Message, Viewtype};
3417
use crate::param::{Param, Params};
35-
use crate::peer_channels::Iroh;
36-
use crate::push::PushSubscriber;
37-
use crate::quota::QuotaInfo;
38-
use crate::scheduler::{convert_folder_meaning, SchedulerState};
39-
use crate::sql::Sql;
40-
use crate::stock_str::StockStrings;
41-
use crate::timesmearing::SmearedTimestamp;
42-
use crate::tools::{self, create_id, duration_to_str, time, time_elapsed};
18+
use crate::tools::{create_id, time};
4319

4420
#[derive(Serialize)]
4521
struct Statistics {
@@ -167,7 +143,8 @@ async fn get_self_report(context: &Context) -> Result<String> {
167143
let key_created = load_self_public_key(context)
168144
.await?
169145
.primary_key
170-
.created_at();
146+
.created_at()
147+
.timestamp();
171148

172149
// how many of the chats active in the last months are:
173150
// - protected

0 commit comments

Comments
 (0)