diff --git a/dynamic-check/src/assertions/type_variable_pair.rs b/dynamic-check/src/assertions/type_variable_pair.rs index b4b5c91aa0..0cf33318ee 100644 --- a/dynamic-check/src/assertions/type_variable_pair.rs +++ b/dynamic-check/src/assertions/type_variable_pair.rs @@ -118,8 +118,8 @@ impl TypeVariablePairs { // If the dimensions do not match, then throw an error. if left_dimensions_flat.ne(&right_dimensions_flat) { return Err(TypeAssertionError::array_dimensions( - left_dimensions_flat, - right_dimensions_flat, + &left_dimensions_flat, + &right_dimensions_flat, span, )); } diff --git a/dynamic-check/src/errors/type_assertion.rs b/dynamic-check/src/errors/type_assertion.rs index 3dd0fe5cf1..4fad9ffeeb 100644 --- a/dynamic-check/src/errors/type_assertion.rs +++ b/dynamic-check/src/errors/type_assertion.rs @@ -19,7 +19,7 @@ use crate::TypeMembership; use leo_static_check::Type; use leo_typed::{Error as FormattedError, Span}; -use std::{borrow::Cow, path::Path}; +use std::path::Path; /// Errors encountered when attempting to solve a type assertion. #[derive(Debug, Error)] @@ -78,7 +78,7 @@ impl TypeAssertionError { /// /// Mismatched array type dimensions. /// - pub fn array_dimensions(dimensions1: Cow<[usize]>, dimensions2: Cow<[usize]>, span: &Span) -> Self { + pub fn array_dimensions(dimensions1: &[usize], dimensions2: &[usize], span: &Span) -> Self { let message = format!( "Expected array with dimensions `{:?}`, found array with dimensions `{:?}`.", dimensions1, dimensions2