mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Fix existing syntactics nits.
This commit is contained in:
parent
7f935f010b
commit
8bb853f643
93 changed files with 393 additions and 397 deletions
|
@ -51,7 +51,7 @@ fn expand_cased<'cx, T>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree],
|
|||
}
|
||||
(_, rest) => {
|
||||
if rest > 0 {
|
||||
cx.span_err(sp, &format!("expected 1 argument, found {}", rest+1));
|
||||
cx.span_err(sp, &format!("expected 1 argument, found {}", rest + 1));
|
||||
}
|
||||
base::DummyResult::expr(sp)
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ use syntax::ptr::P;
|
|||
use syntax::ast::{MetaItem, Expr};
|
||||
use syntax::ast;
|
||||
use syntax::ext::build::AstBuilder;
|
||||
use syntax::ext::deriving::generic::{combine_substructure, EnumMatching, FieldInfo, MethodDef, Struct,
|
||||
Substructure, TraitDef, ty};
|
||||
use syntax::ext::deriving::generic::{combine_substructure, EnumMatching, FieldInfo, MethodDef};
|
||||
use syntax::ext::deriving::generic::{Struct, Substructure, TraitDef, ty};
|
||||
|
||||
pub fn expand_dom_struct(cx: &mut ExtCtxt, sp: Span, _: &MetaItem, anno: Annotatable) -> Annotatable {
|
||||
if let Annotatable::Item(item) = anno {
|
||||
|
|
|
@ -22,7 +22,7 @@ pub fn match_ty_unwrap<'a>(ty: &'a Ty, segments: &[&str]) -> Option<&'a [P<Ty>]>
|
|||
// I could muck around with the maps and find the full path
|
||||
// however the more efficient way is to simply reverse the iterators and zip them
|
||||
// which will compare them in reverse until one of them runs out of segments
|
||||
if seg.iter().rev().zip(segments.iter().rev()).all(|(a,b)| a.identifier.name.as_str() == *b) {
|
||||
if seg.iter().rev().zip(segments.iter().rev()).all(|(a, b)| a.identifier.name.as_str() == *b) {
|
||||
match seg.last() {
|
||||
Some(&PathSegment {parameters: AngleBracketedParameters(ref a), ..}) => {
|
||||
Some(&a.types)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue