Rename to_value to into_value (clippy suggestion)

This commit is contained in:
Andreas Longva 2021-01-26 09:28:15 +01:00
parent 7bef417f99
commit bda8207ffd

View File

@ -226,7 +226,7 @@ impl<'a, T: Clone + Zero> SparseEntry<'a, T> {
///
/// Either clones the underlying reference or returns zero if the entry is not explicitly
/// stored.
pub fn to_value(self) -> T {
pub fn into_value(self) -> T {
match self {
SparseEntry::NonZero(value) => value.clone(),
SparseEntry::Zero => T::zero(),
@ -253,7 +253,7 @@ impl<'a, T: Clone + Zero> SparseEntryMut<'a, T> {
///
/// Either clones the underlying reference or returns zero if the entry is not explicitly
/// stored.
pub fn to_value(self) -> T {
pub fn into_value(self) -> T {
match self {
SparseEntryMut::NonZero(value) => value.clone(),
SparseEntryMut::Zero => T::zero(),