Derive Default where possible

This commit is contained in:
link2xt
2023-02-14 20:54:16 +00:00
parent e11d7c0444
commit 05f0fe0a88
11 changed files with 47 additions and 121 deletions

View File

@@ -27,9 +27,10 @@ pub enum Connectivity {
// the top) take priority. This means that e.g. if any folder has an error - usually
// because there is no internet connection - the connectivity for the whole
// account will be `Notconnected`.
#[derive(Debug, Clone, PartialEq, Eq, EnumProperty, PartialOrd)]
#[derive(Debug, Default, Clone, PartialEq, Eq, EnumProperty, PartialOrd)]
enum DetailedConnectivity {
Error(String),
#[default]
Uninitialized,
Connecting,
Working,
@@ -40,12 +41,6 @@ enum DetailedConnectivity {
NotConfigured,
}
impl Default for DetailedConnectivity {
fn default() -> Self {
DetailedConnectivity::Uninitialized
}
}
impl DetailedConnectivity {
fn to_basic(&self) -> Option<Connectivity> {
match self {