File tree 1 file changed +24
-26
lines changed
1 file changed +24
-26
lines changed Original file line number Diff line number Diff line change @@ -85,32 +85,30 @@ pub fn call_callee(
85
85
let arg_concrete_trait = impl_poly_catalog. bake ( ) . resolve_trait ( & imp. target ) ?;
86
86
let function = ctx. asg . funcs . get ( callee. function ) . unwrap ( ) ;
87
87
88
- let poly_impl_name = impl_using
89
- . name
90
- . as_ref ( )
91
- . ok_or ( ( ) )
92
- . or_else ( |_| {
93
- function
94
- . impl_params
95
- . params
96
- . iter ( )
97
- . filter ( |( param_name, param) | {
98
- param. trait_ref == arg_concrete_trait. trait_ref
99
- && !used_names. contains ( * param_name)
100
- } )
101
- . map ( |( param_name, _) | param_name)
102
- . next ( )
103
- . ok_or_else ( || {
104
- ResolveError :: other (
105
- format ! (
106
- "Excess implementation of trait '{}' is not used by callee" ,
107
- arg_concrete_trait. display( & ctx. asg)
108
- ) ,
109
- impl_arg. source ,
110
- )
111
- } )
112
- } ) ?
113
- . clone ( ) ;
88
+ let poly_impl_name = if let Some ( name) = & impl_using. name {
89
+ name. clone ( )
90
+ } else {
91
+ function
92
+ . impl_params
93
+ . params
94
+ . iter ( )
95
+ . filter ( |( param_name, param) | {
96
+ param. trait_ref == arg_concrete_trait. trait_ref
97
+ && !used_names. contains ( * param_name)
98
+ } )
99
+ . map ( |( param_name, _) | param_name)
100
+ . next ( )
101
+ . ok_or_else ( || {
102
+ ResolveError :: other (
103
+ format ! (
104
+ "Excess implementation of trait '{}' is not used by callee" ,
105
+ arg_concrete_trait. display( & ctx. asg)
106
+ ) ,
107
+ impl_arg. source ,
108
+ )
109
+ } ) ?
110
+ . clone ( )
111
+ } ;
114
112
115
113
if !used_names. insert ( poly_impl_name. clone ( ) ) {
116
114
return Err ( ResolveError :: other (
You can’t perform that action at this time.
0 commit comments