Format everything and add rustfmt to travis (#951)

* Format everything and add rustfmt to travis

* Remove extern crate winit from examples and add force_multiline_blocks

* Format the code properly

* Fix inconsistent period in PULL_REQUEST_TEMPLATE.md

* Only run rustfmt on nightly

* Travis fixings
This commit is contained in:
Osspial 2019-06-21 11:33:15 -04:00 committed by GitHub
parent b1b5aefc4b
commit e2c84725de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 4787 additions and 3679 deletions

View file

@ -4,10 +4,14 @@ use std::{
ops::{Deref, DerefMut},
};
use crate::dpi::{PhysicalPosition, PhysicalSize};
use crate::monitor::VideoMode;
use crate::{
dpi::{PhysicalPosition, PhysicalSize},
monitor::VideoMode,
};
use crate::platform_impl::platform::ffi::{id, nil, CGFloat, CGRect, CGSize, NSInteger, NSUInteger};
use crate::platform_impl::platform::ffi::{
id, nil, CGFloat, CGRect, CGSize, NSInteger, NSUInteger,
};
pub struct Inner {
uiscreen: id,
@ -30,7 +34,9 @@ impl Deref for MonitorHandle {
fn deref(&self) -> &Inner {
unsafe {
assert_main_thread!("`MonitorHandle` methods can only be run on the main thread on iOS");
assert_main_thread!(
"`MonitorHandle` methods can only be run on the main thread on iOS"
);
}
&self.inner
}
@ -39,7 +45,9 @@ impl Deref for MonitorHandle {
impl DerefMut for MonitorHandle {
fn deref_mut(&mut self) -> &mut Inner {
unsafe {
assert_main_thread!("`MonitorHandle` methods can only be run on the main thread on iOS");
assert_main_thread!(
"`MonitorHandle` methods can only be run on the main thread on iOS"
);
}
&mut self.inner
}
@ -89,7 +97,9 @@ impl MonitorHandle {
assert_main_thread!("`MonitorHandle` can only be cloned on the main thread on iOS");
let () = msg_send![uiscreen, retain];
}
MonitorHandle { inner: Inner { uiscreen } }
MonitorHandle {
inner: Inner { uiscreen },
}
}
}
@ -180,7 +190,7 @@ pub unsafe fn uiscreens() -> VecDeque<MonitorHandle> {
loop {
let screen: id = msg_send![screens_enum, nextObject];
if screen == nil {
break result
break result;
}
result.push_back(MonitorHandle::retained_new(screen));
}