Created
September 14, 2021 00:48
-
-
Save Emilgardis/c9b152dcd518f41fbb9e73126b48373e to your computer and use it in GitHub Desktop.
Cargo build hangs - minimized, a bit more rust-lang/rust#88862
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "maybe" | |
version = "0.1.0" | |
edition = "2018" | |
resolver = "2" | |
[dependencies] | |
sqlx = { version = "0.5.7", default-features = false, features = [ | |
"runtime-tokio-native-tls", | |
"postgres" | |
] } | |
actix-web = "4.0.0-beta.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct FooDb; | |
impl FooDb { | |
async fn nested(&self) -> Result<Option<String>, ()> | |
where { | |
( | |
async move { | |
match async move { | |
{ | |
async move { | |
( | |
async move { | |
match async move { | |
{ | |
let db: sqlx::Pool<sqlx::postgres::Postgres> = todo!(); | |
let mut conn = db.acquire().await.unwrap(); | |
Ok::<_, ()>(String::default()) | |
} | |
} | |
.await | |
{ | |
#[allow(clippy::unit_arg)] | |
Ok(x) => Ok::<_, ()>(x), | |
Err(_) => { | |
todo!() | |
} | |
} | |
}, | |
todo!(), | |
) | |
.0 | |
.await | |
} | |
.await | |
.map_err(Into::into) | |
.map(Some) | |
} | |
} | |
.await | |
{ | |
#[allow(clippy::unit_arg)] | |
Ok(x) => Ok(x), | |
Err(e) => Err(e), | |
} | |
}, | |
todo!(), | |
) | |
.0 | |
.await | |
} | |
} | |
use actix_web::{web, HttpResponse}; | |
fn main() -> Result<(), Box<dyn std::error::Error + 'static>> { | |
let __resource = actix_web::Resource::new("update").to(route); | |
todo!() | |
} | |
async fn route( | |
database: web::Data<FooDb>, | |
) -> Result<HttpResponse, Box<dyn std::error::Error + 'static>> { | |
let _token = database.nested().await; | |
todo!(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment