From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A432061B9A for ; Tue, 18 Jan 2022 13:48:59 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 91A3C29EB6 for ; Tue, 18 Jan 2022 13:48:29 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 1AC6229EAD for ; Tue, 18 Jan 2022 13:48:29 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E6AF2460E8 for ; Tue, 18 Jan 2022 13:48:28 +0100 (CET) From: Fabian Ebner To: pve-devel@lists.proxmox.com Date: Tue, 18 Jan 2022 13:48:21 +0100 Message-Id: <20220118124822.87502-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220118124822.87502-1-f.ebner@proxmox.com> References: <20220118124822.87502-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.136 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [repository.rs, config.rs] Subject: [pve-devel] [PATCH proxmox-apt 2/3] clippy fixes X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2022 12:48:59 -0000 Signed-off-by: Fabian Ebner --- src/config.rs | 4 ++-- src/repositories/repository.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index aac8bc5..fcb66cb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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) } diff --git a/src/repositories/repository.rs b/src/repositories/repository.rs index 05b98dd..4c87f11 100644 --- a/src/repositories/repository.rs +++ b/src/repositories/repository.rs @@ -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('/') { -- 2.30.2