mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-04-30 03:28:56 +00:00
fix the type_complexity clippy lint
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
parent
5117a21ec9
commit
cdc2b341b6
@ -193,13 +193,15 @@ pub async fn dir_or_last_from_group(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Catalog = CatalogWriter<TokioWriterAdapter<StdChannelWriter<Error>>>;
|
||||||
|
|
||||||
async fn backup_directory<P: AsRef<Path>>(
|
async fn backup_directory<P: AsRef<Path>>(
|
||||||
client: &BackupWriter,
|
client: &BackupWriter,
|
||||||
dir_path: P,
|
dir_path: P,
|
||||||
archive_name: &BackupArchiveName,
|
archive_name: &BackupArchiveName,
|
||||||
payload_target: Option<&BackupArchiveName>,
|
payload_target: Option<&BackupArchiveName>,
|
||||||
chunk_size: Option<usize>,
|
chunk_size: Option<usize>,
|
||||||
catalog: Option<Arc<Mutex<CatalogWriter<TokioWriterAdapter<StdChannelWriter<Error>>>>>>,
|
catalog: Option<Arc<Mutex<Catalog>>>,
|
||||||
pxar_create_options: pbs_client::pxar::PxarCreateOptions,
|
pxar_create_options: pbs_client::pxar::PxarCreateOptions,
|
||||||
upload_options: UploadOptions,
|
upload_options: UploadOptions,
|
||||||
) -> Result<(BackupStats, Option<BackupStats>), Error> {
|
) -> Result<(BackupStats, Option<BackupStats>), Error> {
|
||||||
|
@ -39,17 +39,15 @@ pub fn read_ticket() -> Result<Arc<str>, Error> {
|
|||||||
Ok(ticket.into())
|
Ok(ticket.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_auth<'a>(
|
type AuthFn<'a> = Pin<
|
||||||
ticket: Arc<str>,
|
|
||||||
headers: &'a HeaderMap,
|
|
||||||
_method: &'a Method,
|
|
||||||
) -> Pin<
|
|
||||||
Box<
|
Box<
|
||||||
dyn Future<Output = Result<(String, Box<dyn UserInformation + Sync + Send>), AuthError>>
|
dyn Future<Output = Result<(String, Box<dyn UserInformation + Sync + Send>), AuthError>>
|
||||||
+ Send
|
+ Send
|
||||||
+ 'a,
|
+ 'a,
|
||||||
>,
|
>,
|
||||||
> {
|
>;
|
||||||
|
|
||||||
|
pub fn check_auth<'a>(ticket: Arc<str>, headers: &'a HeaderMap, _method: &'a Method) -> AuthFn<'a> {
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
match headers.get(hyper::header::AUTHORIZATION) {
|
match headers.get(hyper::header::AUTHORIZATION) {
|
||||||
Some(header) if header.to_str().unwrap_or("") == &*ticket => {
|
Some(header) if header.to_str().unwrap_or("") == &*ticket => {
|
||||||
|
Loading…
Reference in New Issue
Block a user