Prefer slice over vector reference in membership_failed

Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
This commit is contained in:
Collin Chin 2020-10-27 11:07:35 -07:00 committed by GitHub
parent 21c569d950
commit 2133756d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,7 @@ impl TypeAssertionError {
///
/// Given type is not a member of the set of expected types.
///
pub fn membership_failed(given: &Type, set: &Vec<Type>, span: &Span) -> Self {
pub fn membership_failed(given: &Type, set: &[Type], span: &Span) -> Self {
let message = format!(
"Mismatched types. Given type `{}` is not in the expected type set `{:?}`.",
given, set