1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 20:47:46 +00:00

printf: derive Default impl for FormatPrimitive

This commit is contained in:
Jeffrey Finkelstein 2021-09-09 22:24:51 -04:00 committed by Jan Verbeek
parent ce050ca369
commit fc77e51b64

View file

@ -11,6 +11,7 @@ use super::format_field::FormatField;
// output for a number, organized together // output for a number, organized together
// to allow for easy generalization of output manipulation // to allow for easy generalization of output manipulation
// (e.g. max number of digits after decimal) // (e.g. max number of digits after decimal)
#[derive(Default)]
pub struct FormatPrimitive { pub struct FormatPrimitive {
pub prefix: Option<String>, pub prefix: Option<String>,
pub pre_decimal: Option<String>, pub pre_decimal: Option<String>,
@ -18,17 +19,6 @@ pub struct FormatPrimitive {
pub suffix: Option<String>, pub suffix: Option<String>,
} }
impl Default for FormatPrimitive {
fn default() -> FormatPrimitive {
FormatPrimitive {
prefix: None,
pre_decimal: None,
post_decimal: None,
suffix: None,
}
}
}
#[derive(Clone, PartialEq)] #[derive(Clone, PartialEq)]
pub enum Base { pub enum Base {
Ten = 10, Ten = 10,