proxmox-rest-server: pass owned RestEnvironment to get_index

This way we avoid pointers with lifetimes.
This commit is contained in:
Dietmar Maurer
2021-10-04 14:49:25 +02:00
parent 3483a3b3a1
commit 48176b0a77
6 changed files with 34 additions and 38 deletions

View File

@ -12,7 +12,7 @@ use proxmox::try_block;
use proxmox::api::RpcEnvironmentType;
use proxmox::tools::fs::CreateOptions;
use proxmox_rest_server::{daemon, ApiConfig, RestServer};
use proxmox_rest_server::{daemon, ApiConfig, RestServer, RestEnvironment};
use proxmox_backup::server::auth::default_api_auth;
use proxmox_backup::auth_helpers::*;
@ -28,9 +28,7 @@ fn main() {
}
fn get_index<'a>(
_auth_id: Option<String>,
_language: Option<String>,
_api: &'a ApiConfig,
_env: RestEnvironment,
_parts: Parts,
) -> Pin<Box<dyn Future<Output = Response<Body>> + Send + 'a>> {
Box::pin(async move {