File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -106,17 +106,15 @@ impl CanisterBuilder for MotokoBuilder {
106
106
let motoko_info = info. as_info :: < MotokoCanisterInfo > ( ) ?;
107
107
get_imports ( self . cache . as_ref ( ) , & motoko_info, & mut * pool. imports . borrow_mut ( ) , pool) ?;
108
108
109
- // let iter = Bfs::new( pool.imports.borrow().graph) ;
109
+ let graph = & pool. imports . borrow ( ) . graph ;
110
110
match petgraph:: algo:: toposort ( & pool. imports . borrow ( ) . graph , None ) {
111
111
Ok ( order) => {
112
- let graph = & pool. imports . borrow ( ) . graph ;
113
112
Ok ( order. into_iter ( ) . filter_map ( |id| match graph. node_weight ( id) {
114
113
Some ( MotokoImport :: Canister ( name) ) => pool. get_first_canister_with_name ( name. as_str ( ) ) , // TODO: a little inefficient
115
114
_ => None ,
116
115
} ) . map ( |canister| canister. canister_id ( ) ) . collect ( ) )
117
116
}
118
117
Err ( err) => {
119
- let graph = & pool. imports . borrow ( ) . graph ;
120
118
let message = match graph. node_weight ( err. node_id ( ) ) {
121
119
Some ( canister_id) => match canister_id {
122
120
MotokoImport :: Canister ( name) => name. clone ( ) , // TODO: Can deal without `clone()`?
You can’t perform that action at this time.
0 commit comments