cargo fmt

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2022-07-21 13:33:37 +02:00
parent 03bba92a8b
commit 95e5e59fd0
2 changed files with 12 additions and 9 deletions

View File

@ -104,7 +104,10 @@ pub mod export {
);
}
if let Some(file) = files.iter_mut().find(|file| file.path.as_ref() == Some(&path)) {
if let Some(file) = files
.iter_mut()
.find(|file| file.path.as_ref() == Some(&path))
{
file.repositories.push(repo);
file.write()?;
@ -145,7 +148,10 @@ pub mod export {
bail!("unable to parse file {} - {}", error.path, error.error);
}
if let Some(file) = files.iter_mut().find(|file| file.path.as_ref() == Some(&path.to_string())) {
if let Some(file) = files
.iter_mut()
.find(|file| file.path.as_ref() == Some(&path.to_string()))
{
if let Some(repo) = file.repositories.get_mut(index) {
if let Some(enabled) = options.enabled {
repo.set_enabled(enabled);

View File

@ -1,13 +1,13 @@
#[perlmod::package(name = "PVE::RS::OpenId", lib = "pve_rs")]
mod export {
use std::sync::Mutex;
use std::convert::TryFrom;
use std::sync::Mutex;
use anyhow::Error;
use perlmod::{to_value, Value};
use proxmox_openid::{OpenIdConfig, OpenIdAuthenticator, PrivateAuthState};
use proxmox_openid::{OpenIdAuthenticator, OpenIdConfig, PrivateAuthState};
const CLASSNAME: &str = "PVE::RS::OpenId";
@ -44,7 +44,6 @@ mod export {
config: OpenIdConfig,
redirect_url: &str,
) -> Result<Value, Error> {
let open_id = OpenIdAuthenticator::discover(&config, redirect_url)?;
bless(
class,
@ -60,7 +59,6 @@ mod export {
state_dir: &str,
realm: &str,
) -> Result<String, Error> {
let open_id = this.inner.lock().unwrap();
open_id.authorize_url(state_dir, realm)
}
@ -79,7 +77,6 @@ mod export {
code: &str,
private_auth_state: PrivateAuthState,
) -> Result<Value, Error> {
let open_id = this.inner.lock().unwrap();
let claims = open_id.verify_authorization_code_simple(code, &private_auth_state)?;