Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdavid committed Dec 18, 2024
1 parent 4fc9f2f commit 45f250f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions rust/candid/src/types/type_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item=(&TypeKey, &Type)>
{
pub fn to_sorted_iter(&self) -> impl Iterator<Item = (&TypeKey, &Type)> {
let mut vec: Vec<_> = self.0.iter().collect();
vec.sort_unstable_by_key(|elem| elem.0);
vec.into_iter()
Expand Down
2 changes: 1 addition & 1 deletion rust/candid/src/types/type_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl TypeKey {
index: idx,
name: Default::default(),
}
.into()
.into()
}

pub fn as_str(&self) -> &str {
Expand Down
9 changes: 5 additions & 4 deletions rust/candid_parser/tests/parse_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 45f250f

Please sign in to comment.