File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -249,14 +249,14 @@ extern {
249
249
///
250
250
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed
251
251
#[ wasm_bindgen( catch, method, js_name = toFixed) ]
252
- pub fn to_fixed ( this : & Number , digits : u8 ) -> Result < String , JsValue > ;
252
+ pub fn to_fixed ( this : & Number , digits : u8 ) -> Result < JsString , JsValue > ;
253
253
254
254
/// The toExponential() method returns a string representing the Number
255
255
/// object in exponential notation.
256
256
///
257
257
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential
258
258
#[ wasm_bindgen( catch, method, js_name = toExponential) ]
259
- pub fn to_exponential ( this : & Number , fraction_digits : u8 ) -> Result < String , JsValue > ;
259
+ pub fn to_exponential ( this : & Number , fraction_digits : u8 ) -> Result < JsString , JsValue > ;
260
260
261
261
/// The toString() method returns a string representing the
262
262
/// specified Number object.
Original file line number Diff line number Diff line change @@ -138,11 +138,11 @@ fn to_fixed() {
138
138
use wasm_bindgen::js;
139
139
140
140
#[wasm_bindgen]
141
- pub fn to_fixed(this: &js::Number, digits: u8) -> String {
141
+ pub fn to_fixed(this: &js::Number, digits: u8) -> js::JsString {
142
142
let result = this.to_fixed(digits);
143
143
let result = match result {
144
144
Ok(num) => num,
145
- Err(_err) => "RangeError".to_string ()
145
+ Err(_err) => "RangeError".into ()
146
146
};
147
147
result
148
148
}
@@ -170,11 +170,11 @@ fn to_exponential() {
170
170
use wasm_bindgen::js;
171
171
172
172
#[wasm_bindgen]
173
- pub fn to_exponential(this: &js::Number, fraction_digits: u8) -> String {
173
+ pub fn to_exponential(this: &js::Number, fraction_digits: u8) -> js::JsString {
174
174
let result = this.to_exponential(fraction_digits);
175
175
let result = match result {
176
176
Ok(num) => num,
177
- Err(_err) => "RangeError".to_string ()
177
+ Err(_err) => "RangeError".into ()
178
178
};
179
179
result
180
180
}
You can’t perform that action at this time.
0 commit comments