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() {
35
35
// Test for a function that accepts named arguments
36
36
bundle
37
37
. add_function ( "BASE_OWNERSHIP" , |_args, named_args| {
38
- return match named_args. get ( "ownership" ) {
38
+ match named_args. get ( "ownership" ) {
39
39
Some ( FluentValue :: String ( ref string) ) => {
40
40
format ! ( "All your base belong to {}" , string) . into ( )
41
41
}
42
42
_ => FluentValue :: Error ,
43
- } ;
43
+ }
44
44
} )
45
45
. expect ( "Failed to add a function to the bundle." ) ;
46
46
Original file line number Diff line number Diff line change @@ -150,11 +150,7 @@ impl FluentNumber {
150
150
if let Some ( minfd) = self . options . minimum_fraction_digits {
151
151
if let Some ( pos) = val. find ( '.' ) {
152
152
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) ;
158
154
val = format ! ( "{}{}" , val, "0" . repeat( missing) ) ;
159
155
} else {
160
156
val = format ! ( "{}.{}" , val, "0" . repeat( minfd) ) ;
You can’t perform that action at this time.
0 commit comments