我尝试将actix_rt更新到2.0.2,但自那以后一直遇到以下错误:
thread 'main' panicked at 'System is not running'
这是我的最简实例:
# Cargo.toml
[dependencies]
actix = "0.10"
actix-web = { version = "3.3.2", default-features = false }
actix-rt = "2.0.2"
//! main.rs
use actix_rt;
use actix_web::{HttpServer, App, HttpResponse};
async fn hello() -> HttpResponse {
HttpResponse::Ok().finish()
}
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
let server = HttpServer::new(move || {
App::new().route("/", actix_web::web::get().to(hello))
});
server.bind("127.0.0.1:8080")?.run().await
}
我猜这一定是actix crates之间的某些版本不兼容。我需要actix_rt 2.0.x,以便与Criterion集成。
是否有一组版本号可以使它们一起工作?