Correct borrowing

The previous code does not allow a good solution by just changing the function parameters, unless I am mistaken.

This code allows "&dyn Licensed" to be substituted for "??" and works well.
This commit is contained in:
Anri Lombard 2023-01-06 16:25:01 +02:00 committed by GitHub
parent c5898ac6b7
commit c0dd85ac0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ mod tests {
let some_software = SomeSoftware {};
let other_software = OtherSoftware {};
assert!(compare_license_types(some_software, other_software));
assert!(compare_license_types(&some_software, &other_software));
}
#[test]
@ -41,6 +41,6 @@ mod tests {
let some_software = SomeSoftware {};
let other_software = OtherSoftware {};
assert!(compare_license_types(other_software, some_software));
assert!(compare_license_types(&other_software, &some_software));
}
}