diff --git a/components/util/vec.rs b/components/util/vec.rs index 049cfb49bb0..638164971e4 100644 --- a/components/util/vec.rs +++ b/components/util/vec.rs @@ -39,8 +39,8 @@ impl FullBinarySearchMethods for [T] { return None; } - let mut low : isize = 0; - let mut high : isize = (self.len() as isize) - 1; + let mut low: isize = 0; + let mut high: isize = (self.len() as isize) - 1; while low <= high { // http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index 8d72b8f97a1..5db74cf17f6 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -58,19 +58,19 @@ bitflags! { // Some shortcuts use Cmd on Mac and Control on other systems. #[cfg(all(feature = "window", target_os="macos"))] -const CMD_OR_CONTROL : constellation_msg::KeyModifiers = SUPER; +const CMD_OR_CONTROL: constellation_msg::KeyModifiers = SUPER; #[cfg(all(feature = "window", not(target_os="macos")))] -const CMD_OR_CONTROL : constellation_msg::KeyModifiers = CONTROL; +const CMD_OR_CONTROL: constellation_msg::KeyModifiers = CONTROL; // Some shortcuts use Cmd on Mac and Alt on other systems. #[cfg(all(feature = "window", target_os="macos"))] -const CMD_OR_ALT : constellation_msg::KeyModifiers = SUPER; +const CMD_OR_ALT: constellation_msg::KeyModifiers = SUPER; #[cfg(all(feature = "window", not(target_os="macos")))] -const CMD_OR_ALT : constellation_msg::KeyModifiers = ALT; +const CMD_OR_ALT: constellation_msg::KeyModifiers = ALT; // This should vary by zoom level and maybe actual text size (focused or under cursor) #[cfg(feature = "window")] -const LINE_HEIGHT : f32 = 38.0; +const LINE_HEIGHT: f32 = 38.0; /// The type of a window. #[cfg(feature = "window")] diff --git a/python/tidy.py b/python/tidy.py index 903715b472a..e2583ce87ba 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -232,9 +232,11 @@ def check_rust(file_name, contents): if match: yield (idx + 1, "missing space after ->") - # Avoid flagging ::crate::mod - if line.find(" :[^:]") != -1: - yield (idx + 1, "extra space before :") + # Avoid flagging ::crate::mod and `trait Foo : Bar` + match = line.find(" :") + if match != -1: + if line[0:match].find('trait ') == -1 and line[match + 2] != ':': + yield (idx + 1, "extra space before :") # Avoid flagging crate::mod match = re.search(r"[^:]:[A-Za-z]", line)