tree-wide: run cargo fmt

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
 [ TL: squash in small changes from re-run on current master ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Lukas Wagner 2024-08-02 14:25:42 +02:00 committed by Thomas Lamprecht
parent 8a35f2e4d5
commit f885544707
2 changed files with 10 additions and 11 deletions

View File

@ -8,6 +8,7 @@ mod export {
use perlmod::Value;
use proxmox_http_error::HttpError;
use proxmox_notify::api::Target;
use proxmox_notify::endpoints::gotify::{
DeleteableGotifyProperty, GotifyConfig, GotifyConfigUpdater, GotifyPrivateConfig,
GotifyPrivateConfigUpdater,
@ -27,7 +28,6 @@ mod export {
MatcherConfigUpdater, SeverityMatcher,
};
use proxmox_notify::{api, Config, Notification, Severity};
use proxmox_notify::api::Target;
pub struct NotificationConfig {
config: Mutex<Config>,
@ -114,9 +114,7 @@ mod export {
}
#[export(serialize_error)]
fn get_targets(
#[try_from_ref] this: &NotificationConfig,
) -> Result<Vec<Target>, HttpError> {
fn get_targets(#[try_from_ref] this: &NotificationConfig) -> Result<Vec<Target>, HttpError> {
let config = this.config.lock().unwrap();
api::get_targets(&config)
}
@ -429,10 +427,7 @@ mod export {
endpoint_config: WebhookConfig,
) -> Result<(), HttpError> {
let mut config = this.config.lock().unwrap();
api::webhook::add_endpoint(
&mut config,
endpoint_config,
)
api::webhook::add_endpoint(&mut config, endpoint_config)
}
#[export(serialize_error)]

View File

@ -5,9 +5,9 @@ mod export {
use proxmox_subscription::SubscriptionInfo;
use proxmox_sys::fs::CreateOptions;
use proxmox_http::ProxyConfig;
use proxmox_http::HttpOptions;
use proxmox_http::client::sync::Client;
use proxmox_http::HttpOptions;
use proxmox_http::ProxyConfig;
#[export]
fn read_subscription(path: String) -> Result<Option<SubscriptionInfo>, Error> {
@ -69,7 +69,11 @@ mod export {
Some(url) => Some(ProxyConfig::parse_proxy_url(&url)?),
None => None,
};
let options = HttpOptions { proxy_config, user_agent: Some(user_agent) , ..Default::default() };
let options = HttpOptions {
proxy_config,
user_agent: Some(user_agent),
..Default::default()
};
let client = Client::new(options);
proxmox_subscription::check::check_subscription(key, server_id, product_url, client)