Skip to content

Commit 2a35a77

Browse files
committed
Reorganize module declarations and minor formatting cleanup
1 parent c588b25 commit 2a35a77

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

src/formatting/formatter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ impl Formatter {
912912
}
913913
}
914914

915+
915916
impl ToString for Formatter {
916917
fn to_string(&self) -> String {
917918
let mut result = String::new();

src/language/quantity.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -166,26 +166,6 @@ pub fn convert_superscript(input: &str) -> String {
166166
.collect()
167167
}
168168

169-
fn to_superscript(num: i8) -> String {
170-
num.to_string()
171-
.chars()
172-
.map(|c| match c {
173-
'0' => '⁰',
174-
'1' => '¹',
175-
'2' => '²',
176-
'3' => '³',
177-
'4' => '⁴',
178-
'5' => '⁵',
179-
'6' => '⁶',
180-
'7' => '⁷',
181-
'8' => '⁸',
182-
'9' => '⁹',
183-
'-' => '⁻',
184-
_ => c,
185-
})
186-
.collect()
187-
}
188-
189169
impl Display for Decimal {
190170
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
191171
if self.precision == 0 {
@@ -230,8 +210,28 @@ impl<'i> Display for Quantity<'i> {
230210
}
231211
}
232212

213+
fn to_superscript(num: i8) -> String {
214+
num.to_string()
215+
.chars()
216+
.map(|c| match c {
217+
'0' => '⁰',
218+
'1' => '¹',
219+
'2' => '²',
220+
'3' => '³',
221+
'4' => '⁴',
222+
'5' => '⁵',
223+
'6' => '⁶',
224+
'7' => '⁷',
225+
'8' => '⁸',
226+
'9' => '⁹',
227+
'-' => '⁻',
228+
_ => c,
229+
})
230+
.collect()
231+
}
232+
233233
#[cfg(test)]
234-
mod tests {
234+
mod check {
235235
use super::*;
236236

237237
#[test]

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
pub mod error;
1+
pub mod formatting;
22
pub mod language;
33
pub mod parsing;
44
pub mod regex;
5-
pub mod formatting;

0 commit comments

Comments
 (0)