mirror of
https://git.proxmox.com/git/proxmox
synced 2025-06-08 21:19:48 +00:00
clippy fixes
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9caae7d49e
commit
4bdd6a5148
@ -24,12 +24,12 @@ impl APTConfig {
|
||||
///
|
||||
/// Initializes with default values if init() wasn't called before.
|
||||
pub fn get() -> &'static APTConfig {
|
||||
&GLOBAL_CONFIG.get_or_init(|| APTConfig::new(None, None))
|
||||
GLOBAL_CONFIG.get_or_init(|| APTConfig::new(None, None))
|
||||
}
|
||||
|
||||
/// Initialize the configuration.
|
||||
///
|
||||
/// Only has an effect if no init() or get() has been called yet.
|
||||
pub fn init(config: APTConfig) -> &'static APTConfig {
|
||||
&GLOBAL_CONFIG.get_or_init(|| config)
|
||||
GLOBAL_CONFIG.get_or_init(|| config)
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ fn uri_to_filename(uri: &str) -> String {
|
||||
/// Get the host part from a given URI.
|
||||
fn host_from_uri(uri: &str) -> Option<&str> {
|
||||
let host = uri.strip_prefix("http")?;
|
||||
let host = host.strip_prefix("s").unwrap_or(host);
|
||||
let host = host.strip_prefix('s').unwrap_or(host);
|
||||
let mut host = host.strip_prefix("://")?;
|
||||
|
||||
if let Some(end) = host.find('/') {
|
||||
|
Loading…
Reference in New Issue
Block a user