2022-11-27 16:49:18 -06:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
fn foo(x: &str) -> bool {
|
|
|
|
x.starts_with(&("hi".to_string() + " you"))
|
2023-10-04 20:50:00 -05:00
|
|
|
//~^ ERROR expected a `FnMut(char)` closure, found `String`
|
2022-11-27 16:49:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn foo2(x: &str) -> bool {
|
|
|
|
x.starts_with(&"hi".to_string())
|
2023-10-04 20:50:00 -05:00
|
|
|
//~^ ERROR expected a `FnMut(char)` closure, found `String`
|
2022-11-27 16:49:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
foo("hi you");
|
|
|
|
foo2("hi");
|
|
|
|
}
|