mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 21:36:30 +03:00
Derive Default where possible
This commit is contained in:
@@ -35,6 +35,7 @@ pub(crate) const MIN_DELETE_SERVER_AFTER: i64 = 48 * 60 * 60;
|
||||
/// Download state of the message.
|
||||
#[derive(
|
||||
Debug,
|
||||
Default,
|
||||
Display,
|
||||
Clone,
|
||||
Copy,
|
||||
@@ -50,6 +51,7 @@ pub(crate) const MIN_DELETE_SERVER_AFTER: i64 = 48 * 60 * 60;
|
||||
#[repr(u32)]
|
||||
pub enum DownloadState {
|
||||
/// Message is fully downloaded.
|
||||
#[default]
|
||||
Done = 0,
|
||||
|
||||
/// Message is partially downloaded and can be fully downloaded at request.
|
||||
@@ -62,12 +64,6 @@ pub enum DownloadState {
|
||||
InProgress = 1000,
|
||||
}
|
||||
|
||||
impl Default for DownloadState {
|
||||
fn default() -> Self {
|
||||
DownloadState::Done
|
||||
}
|
||||
}
|
||||
|
||||
impl Context {
|
||||
// Returns validated download limit or `None` for "no limit".
|
||||
pub(crate) async fn download_limit(&self) -> Result<Option<u32>> {
|
||||
|
||||
Reference in New Issue
Block a user