diff --git a/src/lib.rs b/src/lib.rs index d168708..043a66d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1351,8 +1351,8 @@ impl CKAN { let mut custom_map: HashMap = HashMap::new(); opsert("groups", groups, &mut map); opsert("owner_org", owner_org, &mut map); - if let Some(custom) = custom_fields - && custom.is_object() { + if let Some(custom) = custom_fields { + if custom.is_object() { let custom_temp_map = custom.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -1360,6 +1360,7 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } + } map.extend( custom_map .iter() @@ -1980,8 +1981,8 @@ impl CKAN { let mut custom_map: HashMap = HashMap::new(); opsert("groups", groups, &mut map); opsert("owner_org", owner_org, &mut map); - if let Some(custom) = custom_fields - && custom.is_object() { + if let Some(custom) = custom_fields { + if custom.is_object() { let custom_temp_map = custom.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -1989,6 +1990,7 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } + } map.extend( custom_map .iter() @@ -2367,8 +2369,8 @@ impl CKAN { let endpoint = self.url.clone() + "/api/3/action/config_option_update"; let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); let mut custom_map: HashMap = HashMap::new(); - if let Some(options_obj) = options - && options_obj.is_object() { + if let Some(options_obj) = options { + if options_obj.is_object() { let custom_temp_map = options_obj.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -2376,6 +2378,7 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } + } map.extend( custom_map .iter() @@ -2446,8 +2449,8 @@ impl CKAN { let mut custom_map: HashMap = HashMap::new(); opsert("groups", groups, &mut map); opsert("owner_org", owner_org, &mut map); - if let Some(custom) = custom_fields - && custom.is_object() { + if let Some(custom) = custom_fields { + if custom.is_object() { let custom_temp_map = custom.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -2455,6 +2458,7 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } + } map.extend( custom_map .iter()