mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix compile errors
This commit is contained in:
@ -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 }
|
||||
}
|
||||
|
Reference in New Issue
Block a user