diff --git a/src/compile.rs b/src/compile.rs index 220b541..1e1a968 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), } } @@ -1574,7 +1574,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 1b31d78..e3503aa 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() @@ -631,13 +633,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(), ) }); @@ -655,9 +657,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(), + ), } }