From 00977921cbf61c3cf370ebd231d82881d83fed7f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 21 Dec 2020 12:15:49 +0000 Subject: [PATCH] Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio DONTBUILD Updated with rustfmt 1.4.24-stable (eb894d5 2020-11-05) # ignore-this-changeset Depends on D100230 Differential Revision: https://phabricator.services.mozilla.com/D100231 --- gfx/webrender_bindings/src/bindings.rs | 4 ++-- js/src/wasm/cranelift/src/bindings/mod.rs | 2 +- js/src/wasm/cranelift/src/wasm2clif.rs | 5 +---- tools/fuzzing/rust/src/lib.rs | 26 +++++------------------ 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs index bac4007cde73..41edd9856981 100644 --- a/gfx/webrender_bindings/src/bindings.rs +++ b/gfx/webrender_bindings/src/bindings.rs @@ -37,8 +37,8 @@ use webrender::{ api::units::*, api::*, render_api::*, set_profiler_hooks, AsyncPropertySampler, AsyncScreenshotHandle, Compositor, CompositorCapabilities, CompositorConfig, CompositorSurfaceTransform, DebugFlags, Device, NativeSurfaceId, NativeSurfaceInfo, NativeTileId, PartialPresentCompositor, PipelineInfo, ProfilerHooks, RecordedFrameHandle, - Renderer, RendererOptions, RendererStats, SceneBuilderHooks, ShaderPrecacheFlags, Shaders, ThreadListener, - UploadMethod, WrShaders, ONE_TIME_USAGE_HINT, TextureCacheConfig, + Renderer, RendererOptions, RendererStats, SceneBuilderHooks, ShaderPrecacheFlags, Shaders, TextureCacheConfig, + ThreadListener, UploadMethod, WrShaders, ONE_TIME_USAGE_HINT, }; use wr_malloc_size_of::MallocSizeOfOps; diff --git a/js/src/wasm/cranelift/src/bindings/mod.rs b/js/src/wasm/cranelift/src/bindings/mod.rs index 97ec9d371641..88ba07539c28 100644 --- a/js/src/wasm/cranelift/src/bindings/mod.rs +++ b/js/src/wasm/cranelift/src/bindings/mod.rs @@ -41,8 +41,8 @@ pub use self::low_level::CraneliftFuncCompileInput as FuncCompileInput; pub use self::low_level::CraneliftMetadataEntry as MetadataEntry; pub use self::low_level::CraneliftModuleEnvironment as LowLevelModuleEnvironment; pub use self::low_level::CraneliftStaticEnvironment as StaticEnvironment; -pub use self::low_level::TypeIdDescKind; pub use self::low_level::Trap; +pub use self::low_level::TypeIdDescKind; mod low_level; diff --git a/js/src/wasm/cranelift/src/wasm2clif.rs b/js/src/wasm/cranelift/src/wasm2clif.rs index 02ff364ddb7b..86e37bf2f010 100644 --- a/js/src/wasm/cranelift/src/wasm2clif.rs +++ b/js/src/wasm/cranelift/src/wasm2clif.rs @@ -71,10 +71,7 @@ fn imm64(offset: usize) -> ir::immediates::Imm64 { /// setting up a return value to a caller; they may be used/relied upon when /// using an arg that came from a caller, or using a return value that came from /// a callee. -fn init_sig_from_wsig( - call_conv: CallConv, - wsig: &bindings::FuncType, -) -> WasmResult { +fn init_sig_from_wsig(call_conv: CallConv, wsig: &bindings::FuncType) -> WasmResult { let mut sig = ir::Signature::new(call_conv); for arg_type in wsig.args() { diff --git a/tools/fuzzing/rust/src/lib.rs b/tools/fuzzing/rust/src/lib.rs index 9216eb34cadb..1df45153c10b 100644 --- a/tools/fuzzing/rust/src/lib.rs +++ b/tools/fuzzing/rust/src/lib.rs @@ -10,12 +10,8 @@ extern crate rkv; extern crate tempfile; use rkv::backend::{ - BackendEnvironmentBuilder, - SafeMode, - SafeModeDatabase, - SafeModeEnvironment, - SafeModeRoTransaction, - SafeModeRwTransaction, + BackendEnvironmentBuilder, SafeMode, SafeModeDatabase, SafeModeEnvironment, + SafeModeRoTransaction, SafeModeRwTransaction, }; use std::fs; use std::fs::File; @@ -215,11 +211,7 @@ pub extern "C" fn fuzz_rkv_calls(raw_data: *const u8, size: libc::size_t) -> lib } }; - fn store_put + Clone>( - fuzz: &mut I, - env: &Rkv, - store: &SingleStore, - ) { + fn store_put + Clone>(fuzz: &mut I, env: &Rkv, store: &SingleStore) { let key = match get_any_data(fuzz, 1024) { Some(key) => key, None => return, @@ -247,11 +239,7 @@ pub extern "C" fn fuzz_rkv_calls(raw_data: *const u8, size: libc::size_t) -> lib } } - fn store_get + Clone>( - fuzz: &mut I, - env: &Rkv, - store: &SingleStore, - ) { + fn store_get + Clone>(fuzz: &mut I, env: &Rkv, store: &SingleStore) { let key = match get_any_data(fuzz, 1024) { Some(key) => key, None => return, @@ -272,11 +260,7 @@ pub extern "C" fn fuzz_rkv_calls(raw_data: *const u8, size: libc::size_t) -> lib maybe_abort(fuzz, reader).unwrap(); } - fn store_delete + Clone>( - fuzz: &mut I, - env: &Rkv, - store: &SingleStore, - ) { + fn store_delete + Clone>(fuzz: &mut I, env: &Rkv, store: &SingleStore) { let key = match get_any_data(fuzz, 1024) { Some(key) => key, None => return,