mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Fix existing syntactics nits.
This commit is contained in:
parent
7f935f010b
commit
8bb853f643
93 changed files with 393 additions and 397 deletions
|
@ -149,7 +149,7 @@ impl<'a> GlobalRef<'a> {
|
|||
|
||||
/// `ScriptChan` used to send messages to the event loop of this global's
|
||||
/// thread.
|
||||
pub fn script_chan(&self) -> Box<ScriptChan+Send> {
|
||||
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => window.script_chan(),
|
||||
GlobalRef::Worker(ref worker) => worker.script_chan(),
|
||||
|
@ -159,7 +159,7 @@ impl<'a> GlobalRef<'a> {
|
|||
/// Create a new sender/receiver pair that can be used to implement an on-demand
|
||||
/// event loop. Used for implementing web APIs that require blocking semantics
|
||||
/// without resorting to nested event loops.
|
||||
pub fn new_script_pair(&self) -> (Box<ScriptChan+Send>, Box<ScriptPort+Send>) {
|
||||
pub fn new_script_pair(&self) -> (Box<ScriptChan + Send>, Box<ScriptPort + Send>) {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => window.new_script_pair(),
|
||||
GlobalRef::Worker(ref worker) => worker.new_script_pair(),
|
||||
|
|
|
@ -207,11 +207,11 @@ impl MutHeapJSVal {
|
|||
/// `JS<T>`.
|
||||
#[must_root]
|
||||
#[derive(JSTraceable)]
|
||||
pub struct MutHeap<T: HeapGCValue+Copy> {
|
||||
pub struct MutHeap<T: HeapGCValue + Copy> {
|
||||
val: Cell<T>,
|
||||
}
|
||||
|
||||
impl<T: HeapGCValue+Copy> MutHeap<T> {
|
||||
impl<T: HeapGCValue + Copy> MutHeap<T> {
|
||||
/// Create a new `MutHeap`.
|
||||
pub fn new(initial: T) -> MutHeap<T> {
|
||||
MutHeap {
|
||||
|
@ -236,11 +236,11 @@ impl<T: HeapGCValue+Copy> MutHeap<T> {
|
|||
/// barriers are enforced.
|
||||
#[must_root]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
pub struct MutNullableHeap<T: HeapGCValue+Copy> {
|
||||
pub struct MutNullableHeap<T: HeapGCValue + Copy> {
|
||||
ptr: Cell<Option<T>>
|
||||
}
|
||||
|
||||
impl<T: HeapGCValue+Copy> MutNullableHeap<T> {
|
||||
impl<T: HeapGCValue + Copy> MutNullableHeap<T> {
|
||||
/// Create a new `MutNullableHeap`.
|
||||
pub fn new(initial: Option<T>) -> MutNullableHeap<T> {
|
||||
MutNullableHeap {
|
||||
|
@ -288,7 +288,7 @@ impl<T: Reflectable> MutNullableHeap<JS<T>> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: HeapGCValue+Copy> Default for MutNullableHeap<T> {
|
||||
impl<T: HeapGCValue + Copy> Default for MutNullableHeap<T> {
|
||||
fn default() -> MutNullableHeap<T> {
|
||||
MutNullableHeap {
|
||||
ptr: Cell::new(None)
|
||||
|
|
|
@ -178,7 +178,7 @@ impl<T: JSTraceable> JSTraceable for *mut T {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable+Copy> JSTraceable for Cell<T> {
|
||||
impl<T: JSTraceable + Copy> JSTraceable for Cell<T> {
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
self.get().trace(trc)
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ impl<T: JSTraceable, U: JSTraceable> JSTraceable for Result<T, U> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<K,V,S> JSTraceable for HashMap<K, V, S>
|
||||
impl<K, V, S> JSTraceable for HashMap<K, V, S>
|
||||
where K: Hash + Eq + JSTraceable,
|
||||
V: JSTraceable,
|
||||
S: HashState,
|
||||
|
@ -306,7 +306,7 @@ no_jsmanaged_fields!(WebGLError);
|
|||
no_jsmanaged_fields!(ProfilerChan);
|
||||
no_jsmanaged_fields!(PseudoElement);
|
||||
|
||||
impl JSTraceable for Box<ScriptChan+Send> {
|
||||
impl JSTraceable for Box<ScriptChan + Send> {
|
||||
#[inline]
|
||||
fn trace(&self, _trc: *mut JSTracer) {
|
||||
// Do nothing
|
||||
|
@ -327,7 +327,7 @@ impl<'a> JSTraceable for &'a str {
|
|||
}
|
||||
}
|
||||
|
||||
impl<A,B> JSTraceable for fn(A) -> B {
|
||||
impl<A, B> JSTraceable for fn(A) -> B {
|
||||
#[inline]
|
||||
fn trace(&self, _: *mut JSTracer) {
|
||||
// Do nothing
|
||||
|
@ -341,7 +341,7 @@ impl<T> JSTraceable for IpcSender<T> where T: Deserialize + Serialize {
|
|||
}
|
||||
}
|
||||
|
||||
impl JSTraceable for Box<LayoutRPC+'static> {
|
||||
impl JSTraceable for Box<LayoutRPC + 'static> {
|
||||
#[inline]
|
||||
fn trace(&self, _: *mut JSTracer) {
|
||||
// Do nothing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue