Apply #[derive(Default)] fixes suggested by Clippy (#2000)

These were bugging me every time I ran `clippy` 😁
This commit is contained in:
Aarni Koskela
2023-01-19 18:04:43 +02:00
committed by GitHub
parent 3c3da8a88c
commit a0ea8fe22f
3 changed files with 8 additions and 28 deletions

View File

@@ -49,18 +49,13 @@ impl<'a> Stylist<'a> {
}
/// The quotation style used in Python source code.
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, Default, PartialEq, Eq)]
pub enum Quote {
Single,
#[default]
Double,
}
impl Default for Quote {
fn default() -> Self {
Quote::Double
}
}
impl From<Quote> for char {
fn from(val: Quote) -> Self {
match val {
@@ -123,19 +118,14 @@ impl Deref for Indentation {
/// The line ending style used in Python source code.
/// See <https://docs.python.org/3/reference/lexical_analysis.html#physical-lines>
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, Default, PartialEq, Eq)]
pub enum LineEnding {
#[default]
Lf,
Cr,
CrLf,
}
impl Default for LineEnding {
fn default() -> Self {
LineEnding::Lf
}
}
impl Deref for LineEnding {
type Target = str;