File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -229,7 +229,8 @@ pub enum LiteralKind {
229
229
230
230
impl ast:: Literal {
231
231
pub fn token ( & self ) -> SyntaxToken {
232
- let elem = self . syntax ( )
232
+ let elem = self
233
+ . syntax ( )
233
234
. children_with_tokens ( )
234
235
. find ( |e| e. kind ( ) != ATTR && !e. kind ( ) . is_trivia ( ) ) ;
235
236
match elem {
@@ -274,12 +275,7 @@ impl ast::Literal {
274
275
#[ test]
275
276
fn test_literal_with_attr ( ) {
276
277
let parse = ast:: SourceFile :: parse ( r#"const _: &str = { #[attr] "Hello" };"# ) ;
277
- let lit = parse
278
- . tree
279
- . syntax ( )
280
- . descendants ( )
281
- . find_map ( ast:: Literal :: cast)
282
- . unwrap ( ) ;
278
+ let lit = parse. tree . syntax ( ) . descendants ( ) . find_map ( ast:: Literal :: cast) . unwrap ( ) ;
283
279
assert_eq ! ( lit. token( ) . text( ) , r#""Hello""# ) ;
284
280
}
285
281
You can’t perform that action at this time.
0 commit comments