mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix reported test-tidy errors
This fixes lines that were reported to have missing space after a comma.
This commit is contained in:
parent
24bc6dfb52
commit
d61a6e2161
13 changed files with 19 additions and 19 deletions
|
@ -30,7 +30,7 @@ use util::geometry::Au;
|
||||||
|
|
||||||
pub trait FontHandleMethods {
|
pub trait FontHandleMethods {
|
||||||
fn new_from_template(fctx: &FontContextHandle, template: Arc<FontTemplateData>, pt_size: Option<Au>)
|
fn new_from_template(fctx: &FontContextHandle, template: Arc<FontTemplateData>, pt_size: Option<Au>)
|
||||||
-> Result<Self,()>;
|
-> Result<Self, ()>;
|
||||||
fn template(&self) -> Arc<FontTemplateData>;
|
fn template(&self) -> Arc<FontTemplateData>;
|
||||||
fn family_name(&self) -> String;
|
fn family_name(&self) -> String;
|
||||||
fn face_name(&self) -> String;
|
fn face_name(&self) -> String;
|
||||||
|
|
|
@ -167,7 +167,7 @@ impl ApplicableDeclarationsCache {
|
||||||
|
|
||||||
/// An LRU cache of the last few nodes seen, so that we can aggressively try to reuse their styles.
|
/// An LRU cache of the last few nodes seen, so that we can aggressively try to reuse their styles.
|
||||||
pub struct StyleSharingCandidateCache {
|
pub struct StyleSharingCandidateCache {
|
||||||
cache: LRUCache<StyleSharingCandidate,()>,
|
cache: LRUCache<StyleSharingCandidate, ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_common_style_affecting_attributes_from_element(element: &LayoutElement)
|
fn create_common_style_affecting_attributes_from_element(element: &LayoutElement)
|
||||||
|
@ -348,7 +348,7 @@ impl StyleSharingCandidateCache {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn iter<'a>(&'a self) -> Iter<'a,(StyleSharingCandidate,())> {
|
pub fn iter<'a>(&'a self) -> Iter<'a, (StyleSharingCandidate, ())> {
|
||||||
self.cache.iter()
|
self.cache.iter()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
|
||||||
let trait_def = TraitDef {
|
let trait_def = TraitDef {
|
||||||
span: span,
|
span: span,
|
||||||
attributes: Vec::new(),
|
attributes: Vec::new(),
|
||||||
path: ty::Path::new(vec!("dom","bindings","trace","JSTraceable")),
|
path: ty::Path::new(vec!("dom", "bindings", "trace", "JSTraceable")),
|
||||||
additional_bounds: Vec::new(),
|
additional_bounds: Vec::new(),
|
||||||
generics: ty::LifetimeBounds::empty(),
|
generics: ty::LifetimeBounds::empty(),
|
||||||
methods: vec![
|
methods: vec![
|
||||||
|
@ -48,7 +48,7 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
|
||||||
name: "trace",
|
name: "trace",
|
||||||
generics: ty::LifetimeBounds::empty(),
|
generics: ty::LifetimeBounds::empty(),
|
||||||
explicit_self: ty::borrowed_explicit_self(),
|
explicit_self: ty::borrowed_explicit_self(),
|
||||||
args: vec!(ty::Ptr(box ty::Literal(ty::Path::new(vec!("js","jsapi","JSTracer"))),
|
args: vec!(ty::Ptr(box ty::Literal(ty::Path::new(vec!("js", "jsapi", "JSTracer"))),
|
||||||
ty::Raw(ast::MutMutable))),
|
ty::Raw(ast::MutMutable))),
|
||||||
ret_ty: ty::nil_ty(),
|
ret_ty: ty::nil_ty(),
|
||||||
attributes: vec![quote_attr!(cx, #[inline])],
|
attributes: vec![quote_attr!(cx, #[inline])],
|
||||||
|
|
|
@ -23,13 +23,13 @@ impl LintPass for BanPass {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_ty(&mut self, cx: &Context, ty: &ast::Ty) {
|
fn check_ty(&mut self, cx: &Context, ty: &ast::Ty) {
|
||||||
if match_ty_unwrap(ty, &["std","cell","Cell"])
|
if match_ty_unwrap(ty, &["std", "cell", "Cell"])
|
||||||
.and_then(|t| t.get(0))
|
.and_then(|t| t.get(0))
|
||||||
.and_then(|t| match_ty_unwrap(&**t, &["dom", "bindings", "js", "JS"]))
|
.and_then(|t| match_ty_unwrap(&**t, &["dom", "bindings", "js", "JS"]))
|
||||||
.is_some() {
|
.is_some() {
|
||||||
cx.span_lint(BANNED_TYPE, ty.span, "Banned type Cell<JS<T>> detected. Use MutHeap<JS<T>> instead")
|
cx.span_lint(BANNED_TYPE, ty.span, "Banned type Cell<JS<T>> detected. Use MutHeap<JS<T>> instead")
|
||||||
}
|
}
|
||||||
if match_ty_unwrap(ty, &["std","cell","Cell"])
|
if match_ty_unwrap(ty, &["std", "cell", "Cell"])
|
||||||
.and_then(|t| t.get(0))
|
.and_then(|t| t.get(0))
|
||||||
.and_then(|t| match_ty_unwrap(&**t, &["js", "jsval", "JSVal"]))
|
.and_then(|t| match_ty_unwrap(&**t, &["js", "jsval", "JSVal"]))
|
||||||
.is_some() {
|
.is_some() {
|
||||||
|
|
|
@ -60,7 +60,7 @@ impl DocumentLoader {
|
||||||
/// are lots of iframes.
|
/// are lots of iframes.
|
||||||
pub fn new_with_task(resource_task: Arc<ResourceTask>,
|
pub fn new_with_task(resource_task: Arc<ResourceTask>,
|
||||||
data: Option<NotifierData>,
|
data: Option<NotifierData>,
|
||||||
initial_load: Option<Url>,)
|
initial_load: Option<Url>)
|
||||||
-> DocumentLoader {
|
-> DocumentLoader {
|
||||||
let initial_loads = initial_load.into_iter().map(LoadType::PageSource).collect();
|
let initial_loads = initial_load.into_iter().map(LoadType::PageSource).collect();
|
||||||
|
|
||||||
|
|
|
@ -1153,7 +1153,7 @@ impl Drop for CanvasRenderingContext2D {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_color(string: &str) -> Result<RGBA,()> {
|
pub fn parse_color(string: &str) -> Result<RGBA, ()> {
|
||||||
let mut parser = Parser::new(&string);
|
let mut parser = Parser::new(&string);
|
||||||
match CSSColor::parse(&mut parser) {
|
match CSSColor::parse(&mut parser) {
|
||||||
Ok(CSSColor::RGBA(rgba)) => {
|
Ok(CSSColor::RGBA(rgba)) => {
|
||||||
|
|
|
@ -1068,7 +1068,7 @@ impl XMLHttpRequest {
|
||||||
|
|
||||||
fn fetch(&self,
|
fn fetch(&self,
|
||||||
load_data: LoadData,
|
load_data: LoadData,
|
||||||
cors_request: Result<Option<CORSRequest>,()>,
|
cors_request: Result<Option<CORSRequest>, ()>,
|
||||||
global: GlobalRef) -> ErrorResult {
|
global: GlobalRef) -> ErrorResult {
|
||||||
let cors_request = match cors_request {
|
let cors_request = match cors_request {
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
|
|
|
@ -158,7 +158,7 @@ impl<T: ClipboardProvider> TextInput<T> {
|
||||||
if begin.line != end.line {
|
if begin.line != end.line {
|
||||||
let mut s = String::new();
|
let mut s = String::new();
|
||||||
s.push_str(&self.lines[begin.line][begin.index..]);
|
s.push_str(&self.lines[begin.line][begin.index..]);
|
||||||
for (_, line) in self.lines.iter().enumerate().filter(|&(i,_)| begin.line < i && i < end.line) {
|
for (_, line) in self.lines.iter().enumerate().filter(|&(i, _)| begin.line < i && i < end.line) {
|
||||||
s.push_str("\n");
|
s.push_str("\n");
|
||||||
s.push_str(line);
|
s.push_str(line);
|
||||||
}
|
}
|
||||||
|
|
|
@ -826,7 +826,7 @@ pub mod specified {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parses a time according to CSS-VALUES § 6.2.
|
/// Parses a time according to CSS-VALUES § 6.2.
|
||||||
fn parse_dimension(value: CSSFloat, unit: &str) -> Result<Time,()> {
|
fn parse_dimension(value: CSSFloat, unit: &str) -> Result<Time, ()> {
|
||||||
if unit.eq_ignore_ascii_case("s") {
|
if unit.eq_ignore_ascii_case("s") {
|
||||||
Ok(Time(value))
|
Ok(Time(value))
|
||||||
} else if unit.eq_ignore_ascii_case("ms") {
|
} else if unit.eq_ignore_ascii_case("ms") {
|
||||||
|
@ -836,7 +836,7 @@ pub mod specified {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse(input: &mut Parser) -> Result<Time,()> {
|
pub fn parse(input: &mut Parser) -> Result<Time, ()> {
|
||||||
match input.next() {
|
match input.next() {
|
||||||
Ok(Token::Dimension(ref value, ref unit)) => {
|
Ok(Token::Dimension(ref value, ref unit)) => {
|
||||||
Time::parse_dimension(value.value, &unit)
|
Time::parse_dimension(value.value, &unit)
|
||||||
|
|
|
@ -76,7 +76,7 @@ impl<K: Clone + PartialEq, V: Clone> LRUCache<K, V> {
|
||||||
self.entries[last_index].1.clone()
|
self.entries[last_index].1.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn iter<'a>(&'a self) -> Iter<'a,(K, V)> {
|
pub fn iter<'a>(&'a self) -> Iter<'a, (K, V)> {
|
||||||
self.entries.iter()
|
self.entries.iter()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub enum OptionalIpcSender<T> where T: Deserialize + Serialize + Send + Any {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> OptionalIpcSender<T> where T: Deserialize + Serialize + Send + Any {
|
impl<T> OptionalIpcSender<T> where T: Deserialize + Serialize + Send + Any {
|
||||||
pub fn send(&self, value: T) -> Result<(),()> {
|
pub fn send(&self, value: T) -> Result<(), ()> {
|
||||||
match *self {
|
match *self {
|
||||||
OptionalIpcSender::OutOfProcess(ref ipc_sender) => ipc_sender.send(value),
|
OptionalIpcSender::OutOfProcess(ref ipc_sender) => ipc_sender.send(value),
|
||||||
OptionalIpcSender::InProcess(ref sender) => sender.send(value).map_err(|_| ()),
|
OptionalIpcSender::InProcess(ref sender) => sender.send(value).map_err(|_| ()),
|
||||||
|
|
|
@ -435,7 +435,7 @@ pub fn from_cmdline_args(args: &[String]) {
|
||||||
opts.optflag("i", "nonincremental-layout", "Enable to turn off incremental layout.");
|
opts.optflag("i", "nonincremental-layout", "Enable to turn off incremental layout.");
|
||||||
opts.optflag("", "no-ssl", "Disables ssl certificate verification.");
|
opts.optflag("", "no-ssl", "Disables ssl certificate verification.");
|
||||||
opts.optflagopt("", "userscripts",
|
opts.optflagopt("", "userscripts",
|
||||||
"Uses userscripts in resources/user-agent-js, or a specified full path","");
|
"Uses userscripts in resources/user-agent-js, or a specified full path", "");
|
||||||
opts.optmulti("", "user-stylesheet",
|
opts.optmulti("", "user-stylesheet",
|
||||||
"A user stylesheet to be added to every document", "file.css");
|
"A user stylesheet to be added to every document", "file.css");
|
||||||
opts.optflag("z", "headless", "Headless mode");
|
opts.optflag("z", "headless", "Headless mode");
|
||||||
|
|
|
@ -169,7 +169,7 @@ pub fn parse_length(mut value: &str) -> LengthOrPercentageOrAuto {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parses a legacy color per HTML5 § 2.4.6. If unparseable, `Err` is returned.
|
/// Parses a legacy color per HTML5 § 2.4.6. If unparseable, `Err` is returned.
|
||||||
pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
|
pub fn parse_legacy_color(mut input: &str) -> Result<RGBA, ()> {
|
||||||
// Steps 1 and 2.
|
// Steps 1 and 2.
|
||||||
if input.is_empty() {
|
if input.is_empty() {
|
||||||
return Err(())
|
return Err(())
|
||||||
|
@ -277,7 +277,7 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
|
||||||
alpha: 1.0,
|
alpha: 1.0,
|
||||||
});
|
});
|
||||||
|
|
||||||
fn hex(ch: char) -> Result<u8,()> {
|
fn hex(ch: char) -> Result<u8, ()> {
|
||||||
match ch {
|
match ch {
|
||||||
'0'...'9' => Ok((ch as u8) - b'0'),
|
'0'...'9' => Ok((ch as u8) - b'0'),
|
||||||
'a'...'f' => Ok((ch as u8) - b'a' + 10),
|
'a'...'f' => Ok((ch as u8) - b'a' + 10),
|
||||||
|
@ -286,7 +286,7 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA,()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn hex_string(string: &[u8]) -> Result<u8,()> {
|
fn hex_string(string: &[u8]) -> Result<u8, ()> {
|
||||||
match string.len() {
|
match string.len() {
|
||||||
0 => Err(()),
|
0 => Err(()),
|
||||||
1 => hex(string[0] as char),
|
1 => hex(string[0] as char),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue