chore: fmt + docs

This commit is contained in:
Conrad Ludgate 2021-03-01 11:51:52 +00:00
parent 218390b9fb
commit 4a36129c7a
No known key found for this signature in database
GPG key ID: 3DD1A1DB3CB4BF63

View file

@ -9,7 +9,7 @@ use crate::{
// Assist: add_type_ascription // Assist: add_type_ascription
// //
// Adds `: _` before the assignment operator to prompt the user for a type // Adds `: _` before the assignment operator to prompt the user for a type.
// //
// ``` // ```
// fn make<T>() -> T { todo!() } // fn make<T>() -> T { todo!() }
@ -28,7 +28,7 @@ pub(crate) fn add_type_ascription(acc: &mut Assists, ctx: &AssistContext) -> Opt
let let_stmt = ctx.find_node_at_offset::<ast::LetStmt>()?; let let_stmt = ctx.find_node_at_offset::<ast::LetStmt>()?;
if let_stmt.colon_token().is_some() { if let_stmt.colon_token().is_some() {
mark::hit!(add_type_ascription_already_typed); mark::hit!(add_type_ascription_already_typed);
return None return None;
} }
let type_pos = let_stmt.pat()?.syntax().last_token()?.text_range().end(); let type_pos = let_stmt.pat()?.syntax().last_token()?.text_range().end();