mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
cleanup
This commit is contained in:
parent
73e49493bd
commit
c450d0ce41
7 changed files with 7 additions and 18 deletions
|
@ -493,10 +493,10 @@ impl<'a> Printer<'a> {
|
|||
w!(self, "]");
|
||||
}
|
||||
TypeRef::Fn(args_and_ret, varargs) => {
|
||||
let (ret, args) =
|
||||
let ((_, return_type), args) =
|
||||
args_and_ret.split_last().expect("TypeRef::Fn is missing return type");
|
||||
w!(self, "fn(");
|
||||
for (i, (name, typeref)) in args.iter().enumerate() {
|
||||
for (i, (_, typeref)) in args.iter().enumerate() {
|
||||
if i != 0 {
|
||||
w!(self, ", ");
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ impl<'a> Printer<'a> {
|
|||
w!(self, "...");
|
||||
}
|
||||
w!(self, ") -> ");
|
||||
self.print_type_ref(&ret.1);
|
||||
self.print_type_ref(&return_type);
|
||||
}
|
||||
TypeRef::Macro(_ast_id) => {
|
||||
w!(self, "<macro>");
|
||||
|
|
|
@ -189,10 +189,9 @@ impl TypeRef {
|
|||
}
|
||||
|
||||
pl.params().map(|p| (p.pat(), p.ty())).map(|it| {
|
||||
println!("{it:?}");
|
||||
let type_ref = TypeRef::from_ast_opt(ctx, it.1);
|
||||
let name = it.0.unwrap().syntax().text().to_string();
|
||||
(Some(name), type_ref)
|
||||
let name = if it.0.is_some() { Some(it.0.unwrap().syntax().text().to_string()) } else { None };
|
||||
(name, type_ref)
|
||||
}).collect()
|
||||
} else {
|
||||
Vec::new()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue