Skip to content

Commit

Permalink
Merge pull request #7 from fiji-flo/init-usernames
Browse files Browse the repository at this point in the history
init usernames
  • Loading branch information
fiji-flo authored Jul 18, 2019
2 parents 4cb94be + 5b56f9f commit e97d216
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use cis_profile::schema::PublisherAuthority;
use cis_profile::schema::StandardAttributeString;
use cis_profile::schema::StandardAttributeValues;
use failure::Error;
use std::collections::BTreeMap;
use std::iter::FromIterator;

fn create_usernames_key(typ: &str) -> String {
format!("HACK#{}", typ)
Expand Down Expand Up @@ -91,6 +93,10 @@ fn update_and_sign_values_field(
for (k, v) in kv_pairs.into_iter() {
values.insert(k, Some(v));
}
} else {
field.values = Some(KeyValue(BTreeMap::from_iter(
kv_pairs.into_iter().map(|(k, v)| (k, Some(v))),
)))
}
if field.metadata.display.is_none() {
field.metadata.display = Some(Display::Staff);
Expand Down

0 comments on commit e97d216

Please sign in to comment.