-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend useless conversion #5631
Conversation
a4c684a
to
705bfdc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I would also like to see these additional tests, just for some additional coverage:
let _: String = "".to_owned().try_into().unwrap();
// FIXME this is a false negative
if String::from("a") == TryInto::<String>::try_into(String::from("a")).unwrap() {}
let _: String = match String::from("_").try_into() {
Ok(a) => a,
Err(_) => "".into(),
};
The TryInto::<String>::try_into(String::from("a")).unwrap()
does currently not warn while it should, but it's not very important, we can just leave this as a note if someone wants to improve it further. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks you!
@bors + edit: oops |
@bors r+ |
📌 Commit 1801841 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This PR extends
useless_conversion
lint withTryFrom
andTryInto
fixes: #5344
changelog: Extend
useless_conversion
withTryFrom
andTryInto