mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1617369 - Reformat mozglue/ using rustfmt r=glandium
Depends on D64873 Differential Revision: https://phabricator.services.mozilla.com/D64874 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
912a8ce3e9
commit
cafbe9915b
@ -9,14 +9,20 @@ fn main() {
|
||||
let dist_path = {
|
||||
let path = PathBuf::from(env::var_os("MOZ_DIST").unwrap());
|
||||
if !path.is_absolute() || !path.is_dir() {
|
||||
panic!("MOZ_DIST must be an absolute directory, was: {}", path.display());
|
||||
panic!(
|
||||
"MOZ_DIST must be an absolute directory, was: {}",
|
||||
path.display()
|
||||
);
|
||||
}
|
||||
path
|
||||
};
|
||||
let topobjdir = {
|
||||
let path = PathBuf::from(env::var_os("MOZ_TOPOBJDIR").unwrap());
|
||||
if !path.is_absolute() || !path.is_dir() {
|
||||
panic!("MOZ_TOPOBJDIR must be an absolute directory, was: {}", path.display());
|
||||
panic!(
|
||||
"MOZ_TOPOBJDIR must be an absolute directory, was: {}",
|
||||
path.display()
|
||||
);
|
||||
}
|
||||
path
|
||||
};
|
||||
|
@ -2,14 +2,14 @@
|
||||
* 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 arrayvec::{Array, ArrayString};
|
||||
use std::cmp;
|
||||
use std::ops::Deref;
|
||||
use std::os::raw::c_char;
|
||||
use std::os::raw::c_int;
|
||||
use std::cmp;
|
||||
use std::panic;
|
||||
use std::ops::Deref;
|
||||
use arrayvec::{Array, ArrayString};
|
||||
|
||||
#[link(name="wrappers")]
|
||||
#[link(name = "wrappers")]
|
||||
extern "C" {
|
||||
// We can't use MOZ_Crash directly because it may be weakly linked
|
||||
// and rust can't handle that.
|
||||
@ -86,8 +86,11 @@ fn panic_hook(info: &panic::PanicInfo) {
|
||||
let message = ArrayCString::<[_; 512]>::from(message);
|
||||
let filename = ArrayCString::<[_; 512]>::from(filename);
|
||||
unsafe {
|
||||
RustMozCrash(filename.as_ptr() as *const c_char, line as c_int,
|
||||
message.as_ptr() as *const c_char);
|
||||
RustMozCrash(
|
||||
filename.as_ptr() as *const c_char,
|
||||
line as c_int,
|
||||
message.as_ptr() as *const c_char,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user