Покажи Cargo.toml
добавил эту зависимость в cargo.toml
появилось куча других ошибок
error[E0432]: unresolved imports hyper::server::Request, hyper::server::Response
--> src\main.rs:10:21
|
10 | use hyper::server::{Request, Response};
| ^^^^^^^ ^^^^^^^^ no Response in server
| |
| no Request in server
error[E0433]: failed to resolve: could not find uri in hyper
--> src\main.rs:12:12
|
12 | use hyper::uri::RequestUri::{AbsolutePath};
| ^^^ could not find uri in hyper
error[E0432]: unresolved import hyper::net
--> src\main.rs:11:12
|
11 | use hyper::net::Fresh;
| ^^^ could not find net in hyper
error[E0531]: cannot find tuple struct or tuple variant AbsolutePath in this scope
--> src\main.rs:20:9
|
20 | AbsolutePath(ref path) => match (&req.method, &path[..]) {
| ^^^^^^^^^^^^ not found in this scope
error[E0531]: cannot find unit struct, unit variant or constant Get in crate hyper
--> src\main.rs:21:22
|
21 | (&hyper::Get, "/") => {
| ^^^ not found in hyper
error[E0425]: cannot find value NotFound in crate hyper
--> src\main.rs:47:32
|
47 | *res.status_mut() = hyper::NotFound;
| ^^^^^^^^ not found in hyper
|
help: possible candidate is found in another module, you can import it into scope
|
6 | use std::io::ErrorKind::NotFound;
|
error[E0599]: no method named at found for struct regex::Captures<'_> in the current scope
--> src\main.rs:42:42
|
42 | r.write_all(format!("Hello, {}", cap.at(1).unwrap()).as_bytes()).unwrap();
| ^^ method not found in regex::Captures<'_>
error[E0599]: no function or associated item named http found for struct hyper::Server<_, _, _> in the current scope
--> src\main.rs:53:21
|
53 | let _ = Server::http("127.0.0.1:3000").unwrap().handle(handler);
| ^^^^ function or associated item not found in hyper::Server<_, _, _>
warning: unused import: std::io::Write
--> src\main.rs:6:5
|
6 | use std::io::Write;
| ^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
error: aborting due to 8 previous errors
похоже код нужно переписывать