forked from mirrors/gecko-dev
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:
parent
d7e8a09c21
commit
6a4cfe596b
8 changed files with 38 additions and 33 deletions
|
|
@ -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 {
|
let mut surface_info = NativeSurfaceInfo {
|
||||||
origin: DeviceIntPoint::zero(),
|
origin: DeviceIntPoint::zero(),
|
||||||
fbo_id: 0,
|
fbo_id: 0,
|
||||||
|
|
|
||||||
|
|
@ -492,7 +492,10 @@ pub extern "C" fn wgpu_client_create_texture(
|
||||||
|
|
||||||
let view_formats = unsafe { desc.view_formats.as_slice() }.to_vec();
|
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);
|
*bb = make_byte_buf(&action);
|
||||||
|
|
||||||
id
|
id
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ extern crate nserror;
|
||||||
use nserror::*;
|
use nserror::*;
|
||||||
|
|
||||||
extern crate xpcom;
|
extern crate xpcom;
|
||||||
use xpcom::interfaces::{mozIThirdPartyUtil};
|
use xpcom::interfaces::mozIThirdPartyUtil;
|
||||||
use xpcom::{AtomicRefcnt, RefCounted, RefPtr};
|
use xpcom::{AtomicRefcnt, RefCounted, RefPtr};
|
||||||
|
|
||||||
extern crate uuid;
|
extern crate uuid;
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,11 @@ where
|
||||||
incoming_envelopes_json: &[nsCString],
|
incoming_envelopes_json: &[nsCString],
|
||||||
callback: &mozIBridgedSyncEngineCallback,
|
callback: &mozIBridgedSyncEngineCallback,
|
||||||
) -> Result<FerryTask<N>> {
|
) -> 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
|
/// Creates a task to mark a subset of outgoing records as uploaded. This
|
||||||
|
|
|
||||||
|
|
@ -432,10 +432,9 @@ impl FirefoxOptions {
|
||||||
rv.env = FirefoxOptions::load_env(options)?;
|
rv.env = FirefoxOptions::load_env(options)?;
|
||||||
rv.log = FirefoxOptions::load_log(options)?;
|
rv.log = FirefoxOptions::load_log(options)?;
|
||||||
rv.prefs = FirefoxOptions::load_prefs(options)?;
|
rv.prefs = FirefoxOptions::load_prefs(options)?;
|
||||||
if let Some(profile) = FirefoxOptions::load_profile(
|
if let Some(profile) =
|
||||||
settings.profile_root.as_deref(),
|
FirefoxOptions::load_profile(settings.profile_root.as_deref(), options)?
|
||||||
options,
|
{
|
||||||
)? {
|
|
||||||
rv.profile = ProfileType::Path(profile);
|
rv.profile = ProfileType::Path(profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,11 @@ use marionette_rs::common::{
|
||||||
use marionette_rs::marionette::AppStatus;
|
use marionette_rs::marionette::AppStatus;
|
||||||
use marionette_rs::message::{Command, Message, MessageId, Request};
|
use marionette_rs::message::{Command, Message, MessageId, Request};
|
||||||
use marionette_rs::webdriver::{
|
use marionette_rs::webdriver::{
|
||||||
Command as MarionetteWebDriverCommand, Keys as MarionetteKeys,
|
Command as MarionetteWebDriverCommand, Keys as MarionetteKeys, Locator as MarionetteLocator,
|
||||||
Locator as MarionetteLocator, NewWindow as MarionetteNewWindow,
|
NewWindow as MarionetteNewWindow, PrintMargins as MarionettePrintMargins,
|
||||||
PrintMargins as MarionettePrintMargins, PrintOrientation as MarionettePrintOrientation,
|
PrintOrientation as MarionettePrintOrientation, PrintPage as MarionettePrintPage,
|
||||||
PrintPage as MarionettePrintPage, PrintParameters as MarionettePrintParameters,
|
PrintParameters as MarionettePrintParameters, ScreenshotOptions, Script as MarionetteScript,
|
||||||
ScreenshotOptions, Script as MarionetteScript, Selector as MarionetteSelector,
|
Selector as MarionetteSelector, Url as MarionetteUrl, WindowRect as MarionetteWindowRect,
|
||||||
Url as MarionetteUrl, WindowRect as MarionetteWindowRect,
|
|
||||||
};
|
};
|
||||||
use mozdevice::AndroidStorageInput;
|
use mozdevice::AndroidStorageInput;
|
||||||
use serde::de::{self, Deserialize, Deserializer};
|
use serde::de::{self, Deserialize, Deserializer};
|
||||||
|
|
@ -775,12 +774,12 @@ fn try_convert_to_marionette_message(
|
||||||
ElementClear(ref e) => Some(Command::WebDriver(
|
ElementClear(ref e) => Some(Command::WebDriver(
|
||||||
MarionetteWebDriverCommand::ElementClear {
|
MarionetteWebDriverCommand::ElementClear {
|
||||||
id: e.clone().to_string(),
|
id: e.clone().to_string(),
|
||||||
}
|
},
|
||||||
)),
|
)),
|
||||||
ElementClick(ref e) => Some(Command::WebDriver(
|
ElementClick(ref e) => Some(Command::WebDriver(
|
||||||
MarionetteWebDriverCommand::ElementClick {
|
MarionetteWebDriverCommand::ElementClick {
|
||||||
id: e.clone().to_string(),
|
id: e.clone().to_string(),
|
||||||
}
|
},
|
||||||
)),
|
)),
|
||||||
ElementSendKeys(ref e, ref x) => {
|
ElementSendKeys(ref e, ref x) => {
|
||||||
let keys = x.to_marionette()?;
|
let keys = x.to_marionette()?;
|
||||||
|
|
@ -861,17 +860,17 @@ fn try_convert_to_marionette_message(
|
||||||
GetElementRect(ref e) => Some(Command::WebDriver(
|
GetElementRect(ref e) => Some(Command::WebDriver(
|
||||||
MarionetteWebDriverCommand::GetElementRect {
|
MarionetteWebDriverCommand::GetElementRect {
|
||||||
id: e.clone().to_string(),
|
id: e.clone().to_string(),
|
||||||
}
|
},
|
||||||
)),
|
)),
|
||||||
GetElementTagName(ref e) => Some(Command::WebDriver(
|
GetElementTagName(ref e) => Some(Command::WebDriver(
|
||||||
MarionetteWebDriverCommand::GetElementTagName {
|
MarionetteWebDriverCommand::GetElementTagName {
|
||||||
id: e.clone().to_string(),
|
id: e.clone().to_string(),
|
||||||
}
|
},
|
||||||
)),
|
)),
|
||||||
GetElementText(ref e) => Some(Command::WebDriver(
|
GetElementText(ref e) => Some(Command::WebDriver(
|
||||||
MarionetteWebDriverCommand::GetElementText {
|
MarionetteWebDriverCommand::GetElementText {
|
||||||
id: e.clone().to_string(),
|
id: e.clone().to_string(),
|
||||||
}
|
},
|
||||||
)),
|
)),
|
||||||
GetPageSource => Some(Command::WebDriver(
|
GetPageSource => Some(Command::WebDriver(
|
||||||
MarionetteWebDriverCommand::GetPageSource,
|
MarionetteWebDriverCommand::GetPageSource,
|
||||||
|
|
@ -897,18 +896,14 @@ fn try_convert_to_marionette_message(
|
||||||
IsDisplayed(ref e) => Some(Command::WebDriver(
|
IsDisplayed(ref e) => Some(Command::WebDriver(
|
||||||
MarionetteWebDriverCommand::IsDisplayed {
|
MarionetteWebDriverCommand::IsDisplayed {
|
||||||
id: e.clone().to_string(),
|
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(
|
MaximizeWindow => Some(Command::WebDriver(
|
||||||
MarionetteWebDriverCommand::MaximizeWindow,
|
MarionetteWebDriverCommand::MaximizeWindow,
|
||||||
)),
|
)),
|
||||||
|
|
|
||||||
|
|
@ -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.
|
// This is the name of the rust module that we're trying to log in Gecko.
|
||||||
let mut mod_name = CStr::from_ptr(module)
|
let mut mod_name = CStr::from_ptr(module).to_string_lossy().into_owned();
|
||||||
.to_string_lossy()
|
|
||||||
.into_owned();
|
|
||||||
|
|
||||||
let is_pattern_match = mod_name.ends_with("::*");
|
let is_pattern_match = mod_name.ends_with("::*");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::interfaces::{nsISupports};
|
use crate::interfaces::nsISupports;
|
||||||
use libc;
|
use libc;
|
||||||
use nserror::{nsresult, NS_OK};
|
use nserror::{nsresult, NS_OK};
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue