Hello
I want to make a little webserver and connect that to an SQLite database.
I have a problem that's is I can't show my database data on the webpage.
this is my error:
error[E0507]: cannot move out of `email`, a captured variable in an `FnMut` closure
--> src/main.rs:65:58
|
61 | let email: String = names[0].email.to_string();
| ----- captured outer variable
...
65 | Ok::<_, Infallible>(service_fn(move |x| hello(x, email)))
| ^^^^^ move occurs because `email` has type `std::string::String`, which does not implement the `Copy` trait
error[E0507]: cannot move out of `email`, a captured variable in an `FnMut` closure
--> src/main.rs:63:51
|
61 | let email: String = names[0].email.to_string();
| ----- captured outer variable
62 | println!("{}", email);
63 | let make_svc = make_service_fn(move |a| async {
| ___________________________________________________^
64 | | // service_fn converts our function into a `Service`
65 | | Ok::<_, Infallible>(service_fn(move |x| hello(x, email)))
| | -----
| | |
| | move occurs because `email` has type `std::string::String`, which does not implement the `Copy` trait
| | move occurs due to use in generator
66 | | });
| |_____^ move out of `email` occurs here
error: aborting due to 2 previous errors
help me
thank you:)