File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,12 @@ fn main() {
3535 // Test for a function that accepts named arguments
3636 bundle
3737 . add_function ( "BASE_OWNERSHIP" , |_args, named_args| {
38- return match named_args. get ( "ownership" ) {
38+ match named_args. get ( "ownership" ) {
3939 Some ( FluentValue :: String ( ref string) ) => {
4040 format ! ( "All your base belong to {}" , string) . into ( )
4141 }
4242 _ => FluentValue :: Error ,
43- } ;
43+ }
4444 } )
4545 . expect ( "Failed to add a function to the bundle." ) ;
4646
Original file line number Diff line number Diff line change @@ -150,11 +150,7 @@ impl FluentNumber {
150150 if let Some ( minfd) = self . options . minimum_fraction_digits {
151151 if let Some ( pos) = val. find ( '.' ) {
152152 let frac_num = val. len ( ) - pos - 1 ;
153- let missing = if frac_num > minfd {
154- 0
155- } else {
156- minfd - frac_num
157- } ;
153+ let missing = minfd. saturating_sub ( frac_num) ;
158154 val = format ! ( "{}{}" , val, "0" . repeat( missing) ) ;
159155 } else {
160156 val = format ! ( "{}.{}" , val, "0" . repeat( minfd) ) ;
You can’t perform that action at this time.
0 commit comments