From 0270b4bc577ba57f211d25bab161a607b9b94ec5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 May 2019 01:48:44 +0300 Subject: reformat --- crates/ra_parser/src/grammar/items.rs | 4 ++-- crates/ra_parser/src/grammar/items/traits.rs | 4 ++-- crates/ra_parser/src/grammar/type_params.rs | 4 ++-- crates/ra_parser/src/grammar/types.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_parser') diff --git a/crates/ra_parser/src/grammar/items.rs b/crates/ra_parser/src/grammar/items.rs index 6728e395f..7718fbe6a 100644 --- a/crates/ra_parser/src/grammar/items.rs +++ b/crates/ra_parser/src/grammar/items.rs @@ -103,7 +103,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul p.bump_remap(T![auto]); has_mods = true; } - if p.at(IDENT) && p.at_contextual_kw("default") && p.nth(1) == T![impl ] { + if p.at(IDENT) && p.at_contextual_kw("default") && p.nth(1) == T![impl] { p.bump_remap(T![default]); has_mods = true; } @@ -161,7 +161,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul // test unsafe_default_impl // unsafe default impl Foo {} - T![impl ] => { + T![impl] => { traits::impl_block(p); m.complete(p, IMPL_BLOCK); } diff --git a/crates/ra_parser/src/grammar/items/traits.rs b/crates/ra_parser/src/grammar/items/traits.rs index 09ab3bfd4..5fcacfbff 100644 --- a/crates/ra_parser/src/grammar/items/traits.rs +++ b/crates/ra_parser/src/grammar/items/traits.rs @@ -44,7 +44,7 @@ pub(crate) fn trait_item_list(p: &mut Parser) { // test impl_block // impl Foo {} pub(super) fn impl_block(p: &mut Parser) { - assert!(p.at(T![impl ])); + assert!(p.at(T![impl])); p.bump(); if choose_type_params_over_qpath(p) { type_params::opt_type_param_list(p); @@ -130,7 +130,7 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool { // impl impl NotType {} // impl Trait2 for impl NotType {} pub(crate) fn impl_type(p: &mut Parser) { - if p.at(T![impl ]) { + if p.at(T![impl]) { p.error("expected trait or type"); return; } diff --git a/crates/ra_parser/src/grammar/type_params.rs b/crates/ra_parser/src/grammar/type_params.rs index 4bbfed780..ef59b59d3 100644 --- a/crates/ra_parser/src/grammar/type_params.rs +++ b/crates/ra_parser/src/grammar/type_params.rs @@ -150,7 +150,7 @@ pub(super) fn opt_where_clause(p: &mut Parser) { fn is_where_predicate(p: &mut Parser) -> bool { match p.current() { LIFETIME => true, - T![impl ] => false, + T![impl] => false, token => types::TYPE_FIRST.contains(token), } } @@ -170,7 +170,7 @@ fn where_predicate(p: &mut Parser) { p.error("expected colon"); } } - T![impl ] => { + T![impl] => { p.error("expected lifetime or type"); } _ => { diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index 438e3ab0e..c0b722569 100644 --- a/crates/ra_parser/src/grammar/types.rs +++ b/crates/ra_parser/src/grammar/types.rs @@ -25,7 +25,7 @@ fn type_with_bounds_cond(p: &mut Parser, allow_bounds: bool) { T![_] => placeholder_type(p), T![fn] | T![unsafe] | T![extern] => fn_pointer_type(p), T![for] => for_type(p), - T![impl ] => impl_trait_type(p), + T![impl] => impl_trait_type(p), T![dyn ] => dyn_trait_type(p), // Some path types are not allowed to have bounds (no plus) T![<] => path_type_(p, allow_bounds), @@ -221,7 +221,7 @@ pub(super) fn for_type(p: &mut Parser) { // test impl_trait_type // type A = impl Iterator> + 'a; fn impl_trait_type(p: &mut Parser) { - assert!(p.at(T![impl ])); + assert!(p.at(T![impl])); let m = p.start(); p.bump(); type_params::bounds_without_colon(p); -- cgit v1.2.3