Fix some clippy lints

This commit is contained in:
Jeremy Soller 2023-11-15 09:21:13 -07:00
parent 6536231dfc
commit 19ae07bd3b
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
5 changed files with 18 additions and 41 deletions

View file

@ -1,10 +1,7 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
#[cfg(not(feature = "std"))]
use alloc::{
string::{String, ToString},
vec::Vec,
};
use alloc::{string::String, vec::Vec};
use core::{cmp, fmt};
use unicode_segmentation::UnicodeSegmentation;
@ -54,8 +51,9 @@ impl Cursor {
}
/// Whether to associate cursors placed at a boundary between runs with the run before or after it.
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd)]
pub enum Affinity {
#[default]
Before,
After,
}
@ -86,12 +84,6 @@ impl Affinity {
}
}
impl Default for Affinity {
fn default() -> Self {
Affinity::Before
}
}
/// The position of a cursor within a [`Buffer`].
#[derive(Debug)]
pub struct LayoutCursor {