pub fn type_matched_update(&mut self, other: &RealmSetting) -> bool {
    match self {
      RealmSetting::Asset(asset) => {
        if let RealmSetting::Asset(new_asset) = other {
          asset.clear();
          asset.push_str(new_asset);
          true
        } else {
          false
        }
      }
      RealmSetting::Announcement(messages) => {
        if let RealmSetting::Announcement(new_messages) = other {
          messages.clear();
          messages.extend(new_messages.iter().cloned());
          true
        } else {
          false
        }
      }
      RealmSetting::AudioStream(url) => {
        if let RealmSetting::AudioStream(new_url) = other {
          url.clear();
          url.push_str(new_url);
          true
        } else {
          false
        }
      }
      RealmSetting::Realm { server, realm } => {
        if let RealmSetting::Realm { server: new_server, realm: new_realm } = other {
          server.clear();
          server.push_str(new_server);
          realm.clear();
          realm.push_str(new_realm);
          true
        } else {
          false
        }
      }
      RealmSetting::VideoStream(url) => {
        if let RealmSetting::VideoStream(new_url) = other {
          url.clear();
          url.push_str(new_url);
          true
        } else {
          false
        }
      }
    }
  }
/// Update a setting from a value, but only if it's the correct type
Update a setting from a value, but only if it's the correct type
Update a setting from a value but only if it ' s the correct type
pub fn type_matched_update(&mut self, other: &RealmSetting) -> bool {
    match self {
      RealmSetting::Asset(asset) => {
        if let RealmSetting::Asset(new_asset) = other {
          asset.clear();
          asset.push_str(new_asset);
          true
        } else {
          false
        }
      }
      RealmSetting::Announcement(messages) => {
        if let RealmSetting::Announcement(new_messages) = other {
          messages.clear();
          messages.extend(new_messages.iter().cloned());
          true
        } else {
          false
        }
      }
      RealmSetting::AudioStream(url) => {
        if let RealmSetting::AudioStream(new_url) = other {
          url.clear();
          url.push_str(new_url);
          true
        } else {
          false
        }
      }
      RealmSetting::Realm { server, realm } => {
        if let RealmSetting::Realm { server: new_server, realm: new_realm } = other {
          server.clear();
          server.push_str(new_server);
          realm.clear();
          realm.push_str(new_realm);
          true
        } else {
          false
        }
      }
      RealmSetting::VideoStream(url) => {
        if let RealmSetting::VideoStream(new_url) = other {
          url.clear();
          url.push_str(new_url);
          true
        } else {
          false
        }
      }
    }
  }
pub fn type_matched_update ( & mut self , other : & RealmSetting ) -> bool { match self { RealmSetting :: Asset ( asset ) => { if let RealmSetting :: Asset ( new_asset ) = other { asset . clear ( ) ; asset . push_str ( new_asset ) ; true } else { false } } RealmSetting :: Announcement ( messages ) => { if let RealmSetting :: Announcement ( new_messages ) = other { messages . clear ( ) ; messages . extend ( new_messages . iter ( ) . cloned ( ) ) ; true } else { false } } RealmSetting :: AudioStream ( url ) => { if let RealmSetting :: AudioStream ( new_url ) = other { url . clear ( ) ; url . push_str ( new_url ) ; true } else { false } } RealmSetting :: Realm { server , realm } => { if let RealmSetting :: Realm { server : new_server , realm : new_realm } = other { server . clear ( ) ; server . push_str ( new_server ) ; realm . clear ( ) ; realm . push_str ( new_realm ) ; true } else { false } } RealmSetting :: VideoStream ( url ) => { if let RealmSetting :: VideoStream ( new_url ) = other { url . clear ( ) ; url . push_str ( new_url ) ; true } else { false } } } }
Update a setting from a value, but only if it's the correct type
Update a setting from a value but only if it ' s the correct type
&mut self
other
&RealmSetting
&mut self
other
&RealmSetting