Skip to content

Commit 1d0c333

Browse files
committed
Run cargo fmt over all code
1 parent 3697fb7 commit 1d0c333

File tree

9 files changed

+21
-25
lines changed

9 files changed

+21
-25
lines changed

crates/cli-support/src/js/outgoing.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ impl<'a, 'b> Outgoing<'a, 'b> {
148148

149149
self.cx.expose_get_cached_string_from_wasm()?;
150150

151-
self.js.prelude(&format!("const v{} = getCachedStringFromWasm({}, {});", tmp, ptr, len));
151+
self.js.prelude(&format!(
152+
"const v{} = getCachedStringFromWasm({}, {});",
153+
tmp, ptr, len
154+
));
152155

153156
if *owned {
154157
self.prelude_free_cached_string(&ptr, &len)?;

crates/cli-support/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ impl Bindgen {
287287
);
288288
}
289289

290-
self.threads.run(&mut module)
290+
self.threads
291+
.run(&mut module)
291292
.with_context(|_| "failed to prepare module for threading")?;
292293

293294
// If requested, turn all mangled symbols into prettier unmangled

crates/cli-support/src/webidl/mod.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -627,26 +627,20 @@ impl<'a> Context<'a> {
627627
// Make sure to export the `anyref` table for the JS bindings since it
628628
// will need to be initialized. If it doesn't exist though then the
629629
// module must not use it, so we skip it.
630-
let table = self
631-
.module
632-
.tables
633-
.iter()
634-
.find(|t| match t.kind {
635-
walrus::TableKind::Anyref(_) => true,
636-
_ => false,
637-
});
630+
let table = self.module.tables.iter().find(|t| match t.kind {
631+
walrus::TableKind::Anyref(_) => true,
632+
_ => false,
633+
});
638634
let table = match table {
639635
Some(t) => t.id(),
640636
None => return Ok(()),
641637
};
642638
self.module.exports.add("__wbg_anyref_table", table);
643639

644640
let ty = self.module.types.add(&[], &[]);
645-
let (import, import_id) = self.module.add_import_func(
646-
PLACEHOLDER_MODULE,
647-
"__wbindgen_init_anyref_table",
648-
ty,
649-
);
641+
let (import, import_id) =
642+
self.module
643+
.add_import_func(PLACEHOLDER_MODULE, "__wbindgen_init_anyref_table", ty);
650644

651645
self.module.start = Some(match self.module.start {
652646
Some(prev_start) => {

crates/futures/src/legacy_shared.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use std::cell::RefCell;
21
use futures::future;
3-
use std::fmt;
4-
use std::rc::Rc;
52
use futures::prelude::*;
63
use futures::sync::oneshot;
74
use js_sys::Promise;
5+
use std::cell::RefCell;
6+
use std::fmt;
7+
use std::rc::Rc;
88
use wasm_bindgen::prelude::*;
99

1010
/// A Rust `Future` backed by a JavaScript `Promise`.

examples/closures/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ fn setup_clicker(document: &Document) {
106106
.dyn_ref::<HtmlElement>()
107107
.expect("#green-square be an `HtmlElement`")
108108
.set_onclick(Some(a.as_ref().unchecked_ref()));
109-
109+
110110
// See comments in `setup_clock` above for why we use `a.forget()`.
111111
a.forget();
112112
}

examples/raytrace-parallel/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ impl Scene {
9090
});
9191
drop(tx.send(rgb_data));
9292
})?;
93-
let done = rx.map(move |_data| image_data(base, len, width, height).into())
93+
let done = rx
94+
.map(move |_data| image_data(base, len, width, height).into())
9495
.map_err(|_| JsValue::undefined());
9596

9697
Ok(RenderingScene {

src/convert/slices.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use std::prelude::v1::*;
44
use core::slice;
55
use core::str;
66

7-
use cfg_if::cfg_if;
87
use crate::convert::OptionIntoWasmAbi;
98
use crate::convert::{FromWasmAbi, IntoWasmAbi, RefFromWasmAbi, RefMutFromWasmAbi, WasmAbi};
9+
use cfg_if::cfg_if;
1010

1111
if_std! {
1212
use core::mem;
@@ -124,7 +124,6 @@ vectors! {
124124
u8 i8 u16 i16 u32 i32 u64 i64 usize isize f32 f64
125125
}
126126

127-
128127
cfg_if! {
129128
if #[cfg(feature = "enable-interning")] {
130129
#[inline]
@@ -141,7 +140,6 @@ cfg_if! {
141140
}
142141
}
143142

144-
145143
if_std! {
146144
impl<T> IntoWasmAbi for Vec<T> where Box<[T]>: IntoWasmAbi<Abi = WasmSlice> {
147145
type Abi = <Box<[T]> as IntoWasmAbi>::Abi;

src/describe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
44
#![doc(hidden)]
55

6-
use cfg_if::cfg_if;
76
use crate::{Clamped, JsValue};
7+
use cfg_if::cfg_if;
88

99
macro_rules! tys {
1010
($($a:ident)*) => (tys! { @ ($($a)*) 0 });

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ pub mod prelude {
5757
}
5858
}
5959

60-
6160
pub mod convert;
6261
pub mod describe;
6362

0 commit comments

Comments
 (0)