From 5713875b1189274af356eedeedca6cb7319eb9e7 Mon Sep 17 00:00:00 2001 From: Daniel Burgener Date: Tue, 26 Sep 2023 15:02:31 -0400 Subject: [PATCH] Clippy and format --- src/compile.rs | 6 +++--- src/internal_rep.rs | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/compile.rs b/src/compile.rs index c539d2a..2e245fc 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -219,7 +219,7 @@ pub fn extend_type_map( let mut new_type = new_type.inner(&mut warnings); new_type .associated_resources - .append(&mut (associated_resources).into()); + .append(&mut associated_resources); type_map.insert(t.name.to_string(), new_type)?; } Err(e) => errors.append(e), @@ -1537,7 +1537,7 @@ pub fn get_synthetic_resource_name( // resource was defined match associated_resource.get_range() { Some(range) => CascadeString::new(cs_name, range), - None => CascadeString::from(cs_name) + None => CascadeString::from(cs_name), } } @@ -1569,7 +1569,7 @@ fn create_synthetic_resource( if types.get(res_name.as_ref()).is_some() { // A synthetic type with this name already exists, due to a nested association return Err( - match make_duplicate_associate_error(types, dom_info, &class_string) { + match make_duplicate_associate_error(types, dom_info, class_string) { Some(e) => e.into(), None => ErrorItem::Internal(InternalError::new()), }, diff --git a/src/internal_rep.rs b/src/internal_rep.rs index 51cff44..95a0037 100644 --- a/src/internal_rep.rs +++ b/src/internal_rep.rs @@ -621,7 +621,9 @@ impl TypeInfo { use crate::compile::get_synthetic_resource_name; for ann in &self.annotations { - if let AnnotationInfo::Associate(associations) | AnnotationInfo::NestAssociate(associations) = ann { + if let AnnotationInfo::Associate(associations) + | AnnotationInfo::NestAssociate(associations) = ann + { for res in &associations.resources { if res.string_is_instance(&CascadeString::from(associate_name)) && res.get_range(associate_name).is_some() @@ -634,13 +636,13 @@ impl TypeInfo { } } } - let ar_range = self.associated_resources + let ar_range = self + .associated_resources .iter() .find(|a| a.string_is_instance(&associate_name.into())) .and_then(|ar| { ar.get_range( - get_synthetic_resource_name(&self.name, &associate_name.into()) - .as_ref(), + get_synthetic_resource_name(&self.name, &associate_name.into()).as_ref(), ) }); @@ -658,9 +660,9 @@ impl TypeInfo { None } } - None => { - self.explicitly_associates(get_synthetic_resource_name(&self.name, &associate_name.into()).as_ref()) - } + None => self.explicitly_associates( + get_synthetic_resource_name(&self.name, &associate_name.into()).as_ref(), + ), } }