mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
17 lines
339 B
Rust
17 lines
339 B
Rust
|
// 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");
|
||
|
}
|