File tree Expand file tree Collapse file tree 3 files changed +23
-23
lines changed
Expand file tree Collapse file tree 3 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -912,6 +912,7 @@ impl Formatter {
912912 }
913913}
914914
915+
915916impl ToString for Formatter {
916917 fn to_string ( & self ) -> String {
917918 let mut result = String :: new ( ) ;
Original file line number Diff line number Diff 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-
189169impl 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]
Original file line number Diff line number Diff line change 1- pub mod error ;
1+ pub mod formatting ;
22pub mod language;
33pub mod parsing;
44pub mod regex;
5- pub mod formatting;
You can’t perform that action at this time.
0 commit comments