Skip to content

Commit 774537f

Browse files
committed
Fix formatting
1 parent 474a046 commit 774537f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

crates/ra_syntax/src/ast/expr_extensions.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ pub enum LiteralKind {
229229

230230
impl ast::Literal {
231231
pub fn token(&self) -> SyntaxToken {
232-
let elem = self.syntax()
232+
let elem = self
233+
.syntax()
233234
.children_with_tokens()
234235
.find(|e| e.kind() != ATTR && !e.kind().is_trivia());
235236
match elem {
@@ -274,12 +275,7 @@ impl ast::Literal {
274275
#[test]
275276
fn test_literal_with_attr() {
276277
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();
283279
assert_eq!(lit.token().text(), r#""Hello""#);
284280
}
285281

0 commit comments

Comments
 (0)