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

Updated with rustfmt 1.5.1-stable (fc594f1 2023-01-24)
# ignore-this-changeset

Depends on D168658

Differential Revision: https://phabricator.services.mozilla.com/D168659
This commit is contained in:
Andi-Bogdan Postelnicu 2023-02-13 15:02:07 +00:00
parent d7e8a09c21
commit 6a4cfe596b
8 changed files with 38 additions and 33 deletions

View File

@ -1316,7 +1316,13 @@ impl Compositor for WrCompositor {
}
}
fn bind(&mut self, _device: &mut Device, id: NativeTileId, dirty_rect: DeviceIntRect, valid_rect: DeviceIntRect) -> NativeSurfaceInfo {
fn bind(
&mut self,
_device: &mut Device,
id: NativeTileId,
dirty_rect: DeviceIntRect,
valid_rect: DeviceIntRect,
) -> NativeSurfaceInfo {
let mut surface_info = NativeSurfaceInfo {
origin: DeviceIntPoint::zero(),
fbo_id: 0,

View File

@ -492,7 +492,10 @@ pub extern "C" fn wgpu_client_create_texture(
let view_formats = unsafe { desc.view_formats.as_slice() }.to_vec();
let action = DeviceAction::CreateTexture(id, desc.map_label_and_view_formats(|_| label, |_| view_formats));
let action = DeviceAction::CreateTexture(
id,
desc.map_label_and_view_formats(|_| label, |_| view_formats),
);
*bb = make_byte_buf(&action);
id

View File

@ -14,7 +14,7 @@ extern crate nserror;
use nserror::*;
extern crate xpcom;
use xpcom::interfaces::{mozIThirdPartyUtil};
use xpcom::interfaces::mozIThirdPartyUtil;
use xpcom::{AtomicRefcnt, RefCounted, RefPtr};
extern crate uuid;

View File

@ -115,7 +115,11 @@ where
incoming_envelopes_json: &[nsCString],
callback: &mozIBridgedSyncEngineCallback,
) -> Result<FerryTask<N>> {
Self::with_ferry(engine, Ferry::StoreIncoming(incoming_envelopes_json.to_vec()), callback)
Self::with_ferry(
engine,
Ferry::StoreIncoming(incoming_envelopes_json.to_vec()),
callback,
)
}
/// Creates a task to mark a subset of outgoing records as uploaded. This

View File

@ -432,10 +432,9 @@ impl FirefoxOptions {
rv.env = FirefoxOptions::load_env(options)?;
rv.log = FirefoxOptions::load_log(options)?;
rv.prefs = FirefoxOptions::load_prefs(options)?;
if let Some(profile) = FirefoxOptions::load_profile(
settings.profile_root.as_deref(),
options,
)? {
if let Some(profile) =
FirefoxOptions::load_profile(settings.profile_root.as_deref(), options)?
{
rv.profile = ProfileType::Path(profile);
}
}

View File

@ -17,12 +17,11 @@ use marionette_rs::common::{
use marionette_rs::marionette::AppStatus;
use marionette_rs::message::{Command, Message, MessageId, Request};
use marionette_rs::webdriver::{
Command as MarionetteWebDriverCommand, Keys as MarionetteKeys,
Locator as MarionetteLocator, NewWindow as MarionetteNewWindow,
PrintMargins as MarionettePrintMargins, PrintOrientation as MarionettePrintOrientation,
PrintPage as MarionettePrintPage, PrintParameters as MarionettePrintParameters,
ScreenshotOptions, Script as MarionetteScript, Selector as MarionetteSelector,
Url as MarionetteUrl, WindowRect as MarionetteWindowRect,
Command as MarionetteWebDriverCommand, Keys as MarionetteKeys, Locator as MarionetteLocator,
NewWindow as MarionetteNewWindow, PrintMargins as MarionettePrintMargins,
PrintOrientation as MarionettePrintOrientation, PrintPage as MarionettePrintPage,
PrintParameters as MarionettePrintParameters, ScreenshotOptions, Script as MarionetteScript,
Selector as MarionetteSelector, Url as MarionetteUrl, WindowRect as MarionetteWindowRect,
};
use mozdevice::AndroidStorageInput;
use serde::de::{self, Deserialize, Deserializer};
@ -775,12 +774,12 @@ fn try_convert_to_marionette_message(
ElementClear(ref e) => Some(Command::WebDriver(
MarionetteWebDriverCommand::ElementClear {
id: e.clone().to_string(),
}
},
)),
ElementClick(ref e) => Some(Command::WebDriver(
MarionetteWebDriverCommand::ElementClick {
id: e.clone().to_string(),
}
},
)),
ElementSendKeys(ref e, ref x) => {
let keys = x.to_marionette()?;
@ -861,17 +860,17 @@ fn try_convert_to_marionette_message(
GetElementRect(ref e) => Some(Command::WebDriver(
MarionetteWebDriverCommand::GetElementRect {
id: e.clone().to_string(),
}
},
)),
GetElementTagName(ref e) => Some(Command::WebDriver(
MarionetteWebDriverCommand::GetElementTagName {
id: e.clone().to_string(),
}
},
)),
GetElementText(ref e) => Some(Command::WebDriver(
MarionetteWebDriverCommand::GetElementText {
id: e.clone().to_string(),
}
},
)),
GetPageSource => Some(Command::WebDriver(
MarionetteWebDriverCommand::GetPageSource,
@ -897,18 +896,14 @@ fn try_convert_to_marionette_message(
IsDisplayed(ref e) => Some(Command::WebDriver(
MarionetteWebDriverCommand::IsDisplayed {
id: e.clone().to_string(),
}
)),
IsEnabled(ref e) => Some(Command::WebDriver(
MarionetteWebDriverCommand::IsEnabled {
id: e.clone().to_string(),
}
)),
IsSelected(ref e) => Some(Command::WebDriver(
MarionetteWebDriverCommand::IsSelected {
id: e.clone().to_string(),
},
)),
IsEnabled(ref e) => Some(Command::WebDriver(MarionetteWebDriverCommand::IsEnabled {
id: e.clone().to_string(),
})),
IsSelected(ref e) => Some(Command::WebDriver(MarionetteWebDriverCommand::IsSelected {
id: e.clone().to_string(),
})),
MaximizeWindow => Some(Command::WebDriver(
MarionetteWebDriverCommand::MaximizeWindow,
)),

View File

@ -129,9 +129,7 @@ pub unsafe extern "C" fn set_rust_log_level(module: *const c_char, level: u8) {
};
// This is the name of the rust module that we're trying to log in Gecko.
let mut mod_name = CStr::from_ptr(module)
.to_string_lossy()
.into_owned();
let mut mod_name = CStr::from_ptr(module).to_string_lossy().into_owned();
let is_pattern_match = mod_name.ends_with("::*");

View File

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::interfaces::{nsISupports};
use crate::interfaces::nsISupports;
use libc;
use nserror::{nsresult, NS_OK};
use std::cell::Cell;