diff --git a/compiler/cl-ast/src/ast_impl/weight_of.rs b/compiler/cl-ast/src/ast_impl/weight_of.rs index 1ebc1dd..63b02c4 100644 --- a/compiler/cl-ast/src/ast_impl/weight_of.rs +++ b/compiler/cl-ast/src/ast_impl/weight_of.rs @@ -567,13 +567,19 @@ impl WeightOf for Option { impl WeightOf for [T] { fn weight_of(&self) -> usize { - self.iter().map(|t| t.weight_of()).sum() + self.iter().map(WeightOf::weight_of).sum() + } +} + +impl WeightOf for Vec { + fn weight_of(&self) -> usize { + size_of::() + self.iter().map(WeightOf::weight_of).sum::() } } impl WeightOf for Box { fn weight_of(&self) -> usize { - (**self).weight_of() + (**self).weight_of() + size_of::() } }