fix compile errors

This commit is contained in:
appflowy
2021-12-05 14:04:25 +08:00
parent bb07eeb2e2
commit 90b5eca5d9
35 changed files with 281 additions and 155 deletions

View File

@ -1,6 +1,6 @@
use flowy_derive::{ProtoBuf, ProtoBuf_Enum};
#[derive(ProtoBuf_Enum, Debug, Clone)]
#[derive(ProtoBuf_Enum, Debug, Clone, Eq, PartialEq)]
pub enum NetworkType {
UnknownNetworkType = 0,
Wifi = 1,
@ -8,6 +8,17 @@ pub enum NetworkType {
Ethernet = 3,
}
impl NetworkType {
pub fn is_connect(&self) -> bool {
match self {
NetworkType::UnknownNetworkType => false,
NetworkType::Wifi => true,
NetworkType::Cell => true,
NetworkType::Ethernet => true,
}
}
}
impl std::default::Default for NetworkType {
fn default() -> Self { NetworkType::UnknownNetworkType }
}