rust/tests/ui/suggestions/issue-104961.fixed

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
343 B
Rust
Raw Normal View History

// run-rustfix
fn foo(x: &str) -> bool {
x.starts_with(&("hi".to_string() + " you"))
//~^ ERROR expected a `FnMut<(char,)>` closure, found `String`
}
fn foo2(x: &str) -> bool {
x.starts_with(&"hi".to_string())
//~^ ERROR expected a `FnMut<(char,)>` closure, found `String`
}
fn main() {
foo("hi you");
foo2("hi");
}