Derive Default for NumberParts

No need to write this out explicitly.
This commit is contained in:
Colin Benner 2018-11-22 11:20:53 +01:00 committed by Tiffany Bennett
parent 9c5818b2f2
commit 31897c48c1

View file

@ -156,7 +156,7 @@ pub fn to_string(rational: &Num, base: u8, digits: Digits) -> (bool, String) {
/// Several stringified properties of a number which are useful for /// Several stringified properties of a number which are useful for
/// displaying it to a user. /// displaying it to a user.
#[derive(Clone, Debug)] #[derive(Clone, Debug, Default)]
#[cfg_attr(feature = "nightly", derive(Serialize, Deserialize))] #[cfg_attr(feature = "nightly", derive(Serialize, Deserialize))]
pub struct NumberParts { pub struct NumberParts {
/// Present if the number can be concisely represented exactly. /// Present if the number can be concisely represented exactly.
@ -179,21 +179,6 @@ pub struct NumberParts {
pub dimensions: Option<String>, pub dimensions: Option<String>,
} }
impl Default for NumberParts {
fn default() -> Self {
NumberParts {
exact_value: None,
approx_value: None,
factor: None,
divfactor: None,
raw_unit: None,
unit: None,
quantity: None,
dimensions: None,
}
}
}
impl NumberParts { impl NumberParts {
/// A DSL for formatting numbers. /// A DSL for formatting numbers.
/// ///