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:
parent
ce050ca369
commit
fc77e51b64
1 changed files with 1 additions and 11 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue