diff --git a/rust/candid/src/types/type_env.rs b/rust/candid/src/types/type_env.rs index fed6449b..5f5aef1c 100644 --- a/rust/candid/src/types/type_env.rs +++ b/rust/candid/src/types/type_env.rs @@ -140,8 +140,7 @@ impl TypeEnv { /// Creates an iterator that iterates over the types in the order of keys. /// /// The implementation collects elements into a temporary vector and sorts the vector. - pub fn to_sorted_iter(&self) -> impl Iterator - { + pub fn to_sorted_iter(&self) -> impl Iterator { let mut vec: Vec<_> = self.0.iter().collect(); vec.sort_unstable_by_key(|elem| elem.0); vec.into_iter() diff --git a/rust/candid/src/types/type_key.rs b/rust/candid/src/types/type_key.rs index bb77ea47..238f37b2 100644 --- a/rust/candid/src/types/type_key.rs +++ b/rust/candid/src/types/type_key.rs @@ -41,7 +41,7 @@ impl TypeKey { index: idx, name: Default::default(), } - .into() + .into() } pub fn as_str(&self) -> &str { diff --git a/rust/candid_parser/tests/parse_type.rs b/rust/candid_parser/tests/parse_type.rs index 0ef6224a..9e190b64 100644 --- a/rust/candid_parser/tests/parse_type.rs +++ b/rust/candid_parser/tests/parse_type.rs @@ -6,8 +6,8 @@ use candid_parser::types::IDLProg; use candid_parser::typing::{check_file, check_prog}; use goldenfile::Mint; use std::io::Write; -use std::path::Path; use std::panic::AssertUnwindSafe; +use std::path::Path; #[test] fn parse_idl_prog() { @@ -52,9 +52,10 @@ fn compiler_test(resource: &str) { } { match filename.file_name().unwrap().to_str().unwrap() { - "unicode.did" | "escape.did" => { - check_error(AssertUnwindSafe(|| motoko::compile(&env, &actor)), "not a valid Motoko id") - } + "unicode.did" | "escape.did" => check_error( + AssertUnwindSafe(|| motoko::compile(&env, &actor)), + "not a valid Motoko id", + ), _ => { let mut output = mint.new_goldenfile(filename.with_extension("mo")).unwrap();