Hide argument name hint regardless of case

This commit is contained in:
Jacob Pratt 2021-01-09 03:33:28 -05:00
parent 5fe8cb1fba
commit 38dd9aa284
No known key found for this signature in database
GPG Key ID: B80E19E4662B5AA4

View File

@ -353,9 +353,13 @@ fn is_argument_similar_to_param_name(
}
match get_string_representation(argument) {
None => false,
Some(repr) => {
let argument_string = repr.trim_start_matches('_');
argument_string.starts_with(param_name) || argument_string.ends_with(param_name)
Some(mut repr) => {
let param_name = param_name.to_ascii_lowercase();
let argument_string = {
repr.make_ascii_lowercase();
repr.trim_start_matches('_')
};
argument_string.starts_with(&param_name) || argument_string.ends_with(&param_name)
}
}
}
@ -901,6 +905,9 @@ fn main() {
twiddle(true);
doo(true);
const TWIDDLE_UPPERCASE: bool = true;
twiddle(TWIDDLE_UPPERCASE);
let mut param_begin: Param = Param {};
different_order(&param_begin);
different_order(&mut param_begin);