mirror of
https://github.com/tiffany352/rink-rs
synced 2024-11-10 05:34:14 +00:00
Derive Default
for NumberParts
No need to write this out explicitly.
This commit is contained in:
parent
9c5818b2f2
commit
31897c48c1
1 changed files with 1 additions and 16 deletions
|
@ -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.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue