mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-19 03:03:21 +00:00
better &mut
and &
matching
This commit is contained in:
parent
de6db06322
commit
cba694c602
@ -236,13 +236,13 @@ fn should_show_param_hint(
|
||||
argument: &ast::Expr,
|
||||
) -> bool {
|
||||
let argument_string = {
|
||||
let arg_string = argument.syntax().to_string();
|
||||
let arg_split: Vec<char> = arg_string.chars().collect();
|
||||
match arg_split.as_slice() {
|
||||
['&', 'm', 'u', 't', ' ', arg_name @ ..] => arg_name.into_iter().collect::<String>(),
|
||||
['&', arg_name @ ..] => arg_name.into_iter().collect::<String>(),
|
||||
_ => arg_string,
|
||||
let mut arg_string = argument.syntax().to_string();
|
||||
if arg_string.get(0..5) == Some("&mut ") {
|
||||
arg_string = arg_string[5..].to_string();
|
||||
} else if arg_string.get(0..1) == Some("&") {
|
||||
arg_string = arg_string[1..].to_string();
|
||||
}
|
||||
arg_string
|
||||
};
|
||||
if param_name.is_empty()
|
||||
|| argument_string.ends_with(¶m_name)
|
||||
|
Loading…
Reference in New Issue
Block a user