diff options
Diffstat (limited to 'crates/ra_syntax/src/lib.rs')
-rw-r--r-- | crates/ra_syntax/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 219dd0b07..6203b6206 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -255,11 +255,11 @@ fn api_walkthrough() { | |||
255 | let mut func = None; | 255 | let mut func = None; |
256 | for item in file.items() { | 256 | for item in file.items() { |
257 | match item { | 257 | match item { |
258 | ast::Item::FnDef(f) => func = Some(f), | 258 | ast::Item::Fn(f) => func = Some(f), |
259 | _ => unreachable!(), | 259 | _ => unreachable!(), |
260 | } | 260 | } |
261 | } | 261 | } |
262 | let func: ast::FnDef = func.unwrap(); | 262 | let func: ast::Fn = func.unwrap(); |
263 | 263 | ||
264 | // Each AST node has a bunch of getters for children. All getters return | 264 | // Each AST node has a bunch of getters for children. All getters return |
265 | // `Option`s though, to account for incomplete code. Some getters are common | 265 | // `Option`s though, to account for incomplete code. Some getters are common |
@@ -316,7 +316,7 @@ fn api_walkthrough() { | |||
316 | ); | 316 | ); |
317 | 317 | ||
318 | // As well as some iterator helpers: | 318 | // As well as some iterator helpers: |
319 | let f = expr_syntax.ancestors().find_map(ast::FnDef::cast); | 319 | let f = expr_syntax.ancestors().find_map(ast::Fn::cast); |
320 | assert_eq!(f, Some(func)); | 320 | assert_eq!(f, Some(func)); |
321 | assert!(expr_syntax.siblings_with_tokens(Direction::Next).any(|it| it.kind() == T!['}'])); | 321 | assert!(expr_syntax.siblings_with_tokens(Direction::Next).any(|it| it.kind() == T!['}'])); |
322 | assert_eq!( | 322 | assert_eq!( |