Bug 1617369 - Reformat recent rust changes with rustfmt r=emilio,webdriver-reviewers

Updated with rustfmt 1.4.38-stable (db9d1b2 2022-01-20)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D137148
This commit is contained in:
Andi-Bogdan Postelnicu 2022-01-31 17:00:21 +00:00
parent 30631a4a9b
commit 7858c79fb2
9 changed files with 30 additions and 27 deletions

View file

@ -204,7 +204,6 @@ fn handle_mdns_socket(
hosts: &mut HashMap<String, Vec<u8>>,
pending_queries: &mut HashMap<String, Query>,
) -> bool {
// Record a simple marker to see how often this is called.
gecko_profiler::add_untyped_marker(
"handle_mdns_socket",

View file

@ -406,7 +406,7 @@ impl ExternalImageHandler for WrExternalImageHandler {
WrExternalImageType::NativeTexture => ExternalImageSource::NativeTexture(image.handle),
WrExternalImageType::RawData => {
ExternalImageSource::RawData(unsafe { make_slice(image.buff, image.size) })
}
},
WrExternalImageType::Invalid => ExternalImageSource::Invalid,
},
}
@ -627,7 +627,7 @@ pub extern "C" fn wr_renderer_render(
*out_stats = results.stats;
out_dirty_rects.extend(results.dirty_rects);
true
}
},
Err(errors) => {
for e in errors {
warn!(" Failed to render: {:?}", e);
@ -637,7 +637,7 @@ pub extern "C" fn wr_renderer_render(
}
}
false
}
},
}
}
@ -1056,7 +1056,7 @@ impl AsyncPropertySampler for SamplerCallback {
Some(id) => {
generated_frame_id_value = id;
&generated_frame_id_value
}
},
None => ptr::null_mut(),
};
let mut transaction = Transaction::new();
@ -1153,7 +1153,7 @@ pub unsafe extern "C" fn remove_program_binary_disk_cache(prof_path: &nsAString)
Err(_) => {
error!("Failed to remove program binary disk cache");
false
}
},
}
}
@ -1699,7 +1699,7 @@ pub extern "C" fn wr_window_new(
}
*out_err = msg.into_raw();
return false;
}
},
};
unsafe {
@ -2255,11 +2255,11 @@ fn generate_capture_path(path: *const c_char) -> Option<PathBuf> {
writeln!(file, "mozilla-central {}", moz_revision).unwrap();
}
Some(path)
}
},
Err(e) => {
warn!("Unable to create path '{:?}' for capture: {:?}", path, e);
None
}
},
}
}
@ -2309,7 +2309,7 @@ fn read_font_descriptor(bytes: &mut WrVecU8, _index: u32) -> NativeFontHandle {
// Lucida Grande is the fallback font in Gecko, so use that here.
CGFont::from_name(&CFString::from_static_string("Lucida Grande"))
.expect("Failed reading font descriptor and could not load fallback font")
}
},
};
NativeFontHandle(font)
}
@ -2541,7 +2541,7 @@ pub extern "C" fn wr_dp_push_stacking_context(
1.0,
));
has_opacity_animation = true;
}
},
WrAnimationType::Transform => {
transform_binding = Some((
PropertyBinding::Binding(
@ -2553,7 +2553,7 @@ pub extern "C" fn wr_dp_push_stacking_context(
),
anim.key,
));
}
},
_ => unreachable!("{:?} should not create a stacking context", anim.effect_type),
}
}
@ -2579,7 +2579,7 @@ pub extern "C" fn wr_dp_push_stacking_context(
Some(scroll_id) => {
debug_assert_eq!(params.reference_frame_kind, WrReferenceFrameKind::Perspective);
Some(ExternalScrollId(*scroll_id, state.pipeline_id))
}
},
None => None,
};
@ -3978,7 +3978,7 @@ pub extern "C" fn wr_shaders_new(
gfx_critical_note(msg.as_ptr());
}
return ptr::null_mut();
}
},
}));
let shaders = WrShaders(shaders);

View file

@ -683,10 +683,10 @@ impl BlobImageHandler for Moz2dBlobImageHandler {
*visible_rect,
));
command.visible_rect = *visible_rect;
}
},
_ => {
panic!("missing image key");
}
},
}
}
@ -815,7 +815,7 @@ impl Moz2dBlobImageHandler {
},
FontTemplate::Native(ref handle) => {
process_native_font_handle(instance.font_key, handle);
}
},
}
}
}

View file

@ -55,7 +55,7 @@ fn deserialize_program_binary(path: &Path) -> Result<Arc<ProgramBinary>, Error>
ErrorKind::InvalidData,
"Failed to deserialize ProgramBinary",
))
}
},
};
Ok(Arc::new(binary))
@ -204,10 +204,10 @@ impl WrProgramBinaryDiskCache {
match deserialize_program_binary(&path) {
Ok(program) => {
program_cache.load_program_binary(program);
}
},
Err(err) => {
error!("shader-cache: Failed to deserialize program binary: {}", err);
}
},
};
} else {
info!("shader-cache: Program binary not found in disk cache");
@ -229,7 +229,7 @@ impl WrProgramBinaryDiskCache {
Err(err) => {
info!("shader-cache: Could not read startup whitelist: {}", err);
Vec::new()
}
},
};
info!("Loaded startup shader whitelist in {:?}", start.elapsed());

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// Implementation note: It seems tempting to use if cfg!(feature = ...) directly
// in the macro, but that doesn't work, as the feature would be evaluated
// against the dependent crate.

View file

@ -260,8 +260,9 @@ fn parse_args(app: &mut App) -> ProgramResult<Operation> {
}
};
let android_storage =
args.value_of_t::<AndroidStorageInput>("android_storage").unwrap_or(AndroidStorageInput::Auto);
let android_storage = args
.value_of_t::<AndroidStorageInput>("android_storage")
.unwrap_or(AndroidStorageInput::Auto);
let binary = args.value_of("binary").map(PathBuf::from);

View file

@ -24,8 +24,8 @@ use std::sync::Mutex;
#[cfg(feature = "with_gecko")]
use {std::convert::TryInto, std::sync::atomic::AtomicU32, xpcom::interfaces::nsIXULRuntime};
use super::HashState;
use super::metrics::__glean_metric_maps;
use super::HashState;
type EventRecord = (u64, HashMap<i32, String>);

View file

@ -9,7 +9,9 @@
//! 'toolkit/components/glean/metrics.yaml`.
#[cfg(not(feature = "cargo-clippy"))]
include!(mozbuild::objdir_path!("toolkit/components/glean/api/src/metrics.rs"));
include!(mozbuild::objdir_path!(
"toolkit/components/glean/api/src/metrics.rs"
));
#[cfg(not(feature = "cargo-clippy"))]
use crate::private::{EventMetric, EventRecordingError, ExtraKeys};

View file

@ -9,4 +9,6 @@
//! 'toolkit/components/glean/pings.yaml`.
#[cfg(not(feature = "cargo-clippy"))]
include!(mozbuild::objdir_path!("toolkit/components/glean/api/src/pings.rs"));
include!(mozbuild::objdir_path!(
"toolkit/components/glean/api/src/pings.rs"
));