Public Access
fix: format and lint
This commit is contained in:
@@ -275,7 +275,7 @@ impl FieldMapper {
|
||||
pub async fn map_all(&self, entity: &Entity) -> Result<HashMap<String, Value>> {
|
||||
let mut result = HashMap::new();
|
||||
|
||||
for (field_name, _) in &self.mappings {
|
||||
for field_name in self.mappings.keys() {
|
||||
match self.map(field_name, entity).await {
|
||||
Ok(value) => {
|
||||
result.insert(field_name.clone(), value);
|
||||
@@ -540,7 +540,8 @@ fn entity_to_json(entity: &Entity) -> Result<Value> {
|
||||
if let Some(profile) = &s.profile {
|
||||
let mut profile_obj = serde_json::Map::new();
|
||||
if !profile.display_name.is_empty() {
|
||||
profile_obj.insert("display_name".to_string(), json!(&profile.display_name));
|
||||
profile_obj
|
||||
.insert("display_name".to_string(), json!(&profile.display_name));
|
||||
}
|
||||
if !profile.email.is_empty() {
|
||||
profile_obj.insert("email".to_string(), json!(&profile.email));
|
||||
@@ -563,7 +564,8 @@ fn entity_to_json(entity: &Entity) -> Result<Value> {
|
||||
if let Some(profile) = &s.profile {
|
||||
let mut profile_obj = serde_json::Map::new();
|
||||
if !profile.display_name.is_empty() {
|
||||
profile_obj.insert("display_name".to_string(), json!(&profile.display_name));
|
||||
profile_obj
|
||||
.insert("display_name".to_string(), json!(&profile.display_name));
|
||||
}
|
||||
if !profile.email.is_empty() {
|
||||
profile_obj.insert("email".to_string(), json!(&profile.email));
|
||||
|
||||
Reference in New Issue
Block a user