forked from Proxmox/proxmox
api-server, tools: formatting cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9654d1feeb
commit
da40267188
@ -2,9 +2,9 @@ use std::io;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use failure::{bail, Error};
|
use failure::{bail, Error};
|
||||||
use tokio::io::AsyncReadExt;
|
|
||||||
use http::Response;
|
use http::Response;
|
||||||
use hyper::Body;
|
use hyper::Body;
|
||||||
|
use tokio::io::AsyncReadExt;
|
||||||
|
|
||||||
use proxmox::api::{api, router};
|
use proxmox::api::{api, router};
|
||||||
|
|
||||||
|
@ -39,15 +39,10 @@ async fn main_do(www_dir: String) {
|
|||||||
let addr = ([0, 0, 0, 0], 3000).into();
|
let addr = ([0, 0, 0, 0], 3000).into();
|
||||||
|
|
||||||
// And a MakeService to handle each connection...
|
// And a MakeService to handle each connection...
|
||||||
let service = make_service_fn(|_| {
|
let service = make_service_fn(|_| async { Ok::<_, hyper::Error>(service_fn(run_request)) });
|
||||||
async {
|
|
||||||
Ok::<_, hyper::Error>(service_fn(run_request))
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Then bind and serve...
|
// Then bind and serve...
|
||||||
let server = Server::bind(&addr)
|
let server = Server::bind(&addr).serve(service);
|
||||||
.serve(service);
|
|
||||||
|
|
||||||
println!("Serving {} under http://localhost:3000/www/", www_dir);
|
println!("Serving {} under http://localhost:3000/www/", www_dir);
|
||||||
|
|
||||||
|
@ -75,9 +75,7 @@ async fn get_loopback(param: String) -> Result<String, Error> {
|
|||||||
returns: String
|
returns: String
|
||||||
})]
|
})]
|
||||||
fn non_async_test(param: String) -> proxmox::api::ApiFuture<Bytes> {
|
fn non_async_test(param: String) -> proxmox::api::ApiFuture<Bytes> {
|
||||||
Box::pin(async {
|
Box::pin(async { proxmox::api::IntoApiOutput::into_api_output(param) })
|
||||||
proxmox::api::IntoApiOutput::into_api_output(param)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proxmox_api_macro::router! {
|
proxmox_api_macro::router! {
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
mod byte_vec;
|
mod byte_vec;
|
||||||
pub use byte_vec::*;
|
pub use byte_vec::*;
|
||||||
|
|
||||||
|
|
||||||
/// Create an uninitialized byte vector of a specific size.
|
/// Create an uninitialized byte vector of a specific size.
|
||||||
///
|
///
|
||||||
/// This is just a shortcut for:
|
/// This is just a shortcut for:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user