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