Skip to content

Commit 744c626

Browse files
committed
Appease Clippy.
1 parent 5c69ba9 commit 744c626

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/vector/focus.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ where
389389
if !contains(&self.target_range, &phys_index) {
390390
self.set_focus(phys_index);
391391
}
392-
let mut slice: &[A] = self.get_focus();
392+
let mut slice: &[A] = self.get_focus().as_slice();
393393
let mut left = 0;
394394
let mut right = 0;
395395
if self.target_range.start < self.view.start {
@@ -528,10 +528,7 @@ where
528528
/// Returns `None` if the index is out of bounds, or the replaced value
529529
/// otherwise.
530530
pub fn set(&mut self, index: usize, value: A) -> Option<A> {
531-
match self.get_mut(index) {
532-
Some(ref mut pos) => Some(replace(pos, value)),
533-
None => None,
534-
}
531+
self.get_mut(index).map(|pos| replace(pos, value))
535532
}
536533

537534
/// Swap the values at two given indices.
@@ -748,12 +745,12 @@ where
748745
}
749746
}
750747

751-
impl<'a, A> Into<Focus<'a, A>> for FocusMut<'a, A>
748+
impl<'a, A> From<FocusMut<'a, A>> for Focus<'a, A>
752749
where
753750
A: Clone + 'a,
754751
{
755-
fn into(self) -> Focus<'a, A> {
756-
self.unmut()
752+
fn from(f: FocusMut<'a, A>) -> Self {
753+
f.unmut()
757754
}
758755
}
759756

0 commit comments

Comments
 (0)