aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r--crates/ra_hir/src/ty/tests.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index 1e84e2d06..0b7c841df 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -2282,14 +2282,12 @@ fn infer(content: &str) -> String {
2282 types.sort_by_key(|(ptr, _)| (ptr.range().start(), ptr.range().end())); 2282 types.sort_by_key(|(ptr, _)| (ptr.range().start(), ptr.range().end()));
2283 for (syntax_ptr, ty) in &types { 2283 for (syntax_ptr, ty) in &types {
2284 let node = syntax_ptr.to_node(&source_file); 2284 let node = syntax_ptr.to_node(&source_file);
2285 write!( 2285 let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node) {
2286 acc, 2286 (self_param.self_kw_token().range(), "self".to_string())
2287 "{} '{}': {}\n", 2287 } else {
2288 syntax_ptr.range(), 2288 (syntax_ptr.range(), node.text().to_string().replace("\n", " "))
2289 ellipsize(node.text().to_string().replace("\n", " "), 15), 2289 };
2290 ty.display(&db) 2290 write!(acc, "{} '{}': {}\n", range, ellipsize(text, 15), ty.display(&db)).unwrap();
2291 )
2292 .unwrap();
2293 } 2291 }
2294 }; 2292 };
2295 2293