Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdavid committed Dec 18, 2024
1 parent 7cae3c3 commit 4fc9f2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rust/candid/src/types/type_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl TypeEnv {
/// The implementation collects elements into a temporary vector and sorts the vector.
pub fn to_sorted_iter(&self) -> impl Iterator<Item=(&TypeKey, &Type)>
{
let mut vec: Vec<_> = self.iter().collect();
let mut vec: Vec<_> = self.0.iter().collect();
vec.sort_unstable_by_key(|elem| elem.0);
vec.into_iter()
}
Expand Down
9 changes: 6 additions & 3 deletions rust/candid_parser/src/bindings/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,7 @@ pub fn emit_bindgen(tree: &Config, env: &TypeEnv, actor: &Option<Type>) -> (Outp
let def_list = if let Some(actor) = &actor {
chase_actor(&env, actor).unwrap()
} else {
env.0
.to_sorted_iter()
env.to_sorted_iter()
.map(|pair| pair.0.as_str())
.collect::<Vec<_>>()
};
Expand Down Expand Up @@ -1011,7 +1010,11 @@ impl NominalState<'_> {
for (id, ty) in self.state.env.to_sorted_iter() {
let elem = StateElem::Label(id.as_str());
let old = self.state.push_state(&elem);
let ty = self.nominalize(&mut res, &mut vec![TypePath::Id(id.as_str().to_string())], ty);
let ty = self.nominalize(
&mut res,
&mut vec![TypePath::Id(id.as_str().to_string())],
ty,
);
res.0.insert(id.clone(), ty);
self.state.pop_state(old, elem);
}
Expand Down

0 comments on commit 4fc9f2f

Please sign in to comment.