let node = tree.find_node(path);
assert!(node.is_some());
if let Some(node) = node {
- assert!(node.users.get(&user1).is_none());
+ assert!(!node.users.contains_key(&user1));
}
}
for path in &user2_paths {
let node = tree.find_node(path);
assert!(node.is_some());
if let Some(node) = node {
- assert!(node.users.get(&user2).is_none());
+ assert!(!node.users.contains_key(&user2));
}
}
}
}
- if config.interfaces.get("lo").is_none() {
+ if !config.interfaces.contains_key("lo") {
let mut interface = Interface::new(String::from("lo"));
set_method_v4(&mut interface, NetworkConfigMethod::Loopback)?;
interface.interface_type = NetworkInterfaceType::Loopback;
let digest = openssl::sha::sha256(content.as_bytes());
let mut data = CONFIG.parse(USER_CFG_FILENAME, &content)?;
- if data.sections.get("root@pam").is_none() {
+ if !data.sections.contains_key("root@pam") {
let user: User = User {
userid: Userid::root_userid().clone(),
comment: Some("Superuser".to_string()),
if !delete {
// Note: we allow to delete non-existent users
let user_cfg = pbs_config::user::cached_config()?;
- if user_cfg.sections.get(&auth_id.to_string()).is_none() {
+ if !user_cfg.sections.contains_key(&auth_id.to_string()) {
bail!(format!(
"no such {}.",
if auth_id.is_token() {
if let Some(ref pool) = pool {
let (pool_config, _digest) = pbs_config::media_pool::config()?;
- if pool_config.sections.get(pool).is_none() {
+ if !pool_config.sections.contains_key(pool) {
bail!("no such pool ('{}')", pool);
}
}
if let Some(ref pool) = pool {
let (pool_config, _digest) = pbs_config::media_pool::config()?;
- if pool_config.sections.get(pool).is_none() {
+ if !pool_config.sections.contains_key(pool) {
bail!("no such pool ('{}')", pool);
}
}
let digest = openssl::sha::sha256(content.as_bytes());
let mut data = CONFIG.parse(ACME_PLUGIN_CFG_FILENAME, &content)?;
- if data.sections.get("standalone").is_none() {
+ if !data.sections.contains_key("standalone") {
let standalone = StandalonePlugin::default();
data.set_data("standalone", "standalone", &standalone)
.unwrap();