From: Ben Pfaff Date: Fri, 27 Dec 2024 19:28:04 +0000 (-0800) Subject: cleanups X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cc44d5d198193c97f4a652ebb40aa0806bbb428;p=pspp cleanups --- diff --git a/rust/pspp/src/format.rs b/rust/pspp/src/format.rs index 72790b9f35..d547bb94e5 100644 --- a/rust/pspp/src/format.rs +++ b/rust/pspp/src/format.rs @@ -1,4 +1,3 @@ -#![allow(dead_code)] use std::{ fmt::{Display, Formatter, Result as FmtResult}, ops::RangeInclusive, @@ -651,17 +650,17 @@ impl Display for UncheckedFormat { } pub struct Settings { - epoch: Option, + pub epoch: Option, /// Either `'.'` or `','`. - decimal: char, + pub decimal: char, /// Format `F`, `E`, `COMMA`, and `DOT` with leading zero (e.g. `0.5` /// instead of `.5`)? - include_leading_zero: bool, + pub include_leading_zero: bool, /// Custom currency styles. - ccs: EnumMap>, + pub ccs: EnumMap>, } impl Default for Settings { @@ -678,19 +677,19 @@ impl Default for Settings { /// A numeric output style. This can express numeric formats in /// [Category::Basic] and [Category::Custom]. pub struct NumberStyle { - neg_prefix: Affix, - prefix: Affix, - suffix: Affix, - neg_suffix: Affix, + pub neg_prefix: Affix, + pub prefix: Affix, + pub suffix: Affix, + pub neg_suffix: Affix, /// Decimal point: `'.'` or `','`. - decimal: char, + pub decimal: char, /// Grouping character: `'.'` or `','` or `None`. - grouping: Option, + pub grouping: Option, /// Format as `.5` or `0.5`? - include_leading_zero: bool, + pub include_leading_zero: bool, /// An `Affix` may require more bytes than its display width; for example, /// U+00A5 (Â¥) is 2 bytes in UTF-8 but occupies only one display column. @@ -699,13 +698,13 @@ pub struct NumberStyle { /// can be used to size memory allocations: for example, the formatted /// result of `CCA20.5` requires no more than `(20 + extra_bytes)` bytes in /// UTF-8. - extra_bytes: usize, + pub extra_bytes: usize, } pub struct Affix { /// String contents of affix. - s: String, + pub s: String, /// Display width in columns (see [unicode_width]) - width: usize, + pub width: usize, }