public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-apt 2/3] clippy fixes
Date: Tue, 18 Jan 2022 13:48:21 +0100	[thread overview]
Message-ID: <20220118124822.87502-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20220118124822.87502-1-f.ebner@proxmox.com>

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 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





  reply	other threads:[~2022-01-18 12:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18 12:48 [pve-devel] [PATCH proxmox-apt 1/3] upgrade to edition 2021 Fabian Ebner
2022-01-18 12:48 ` Fabian Ebner [this message]
2022-01-18 12:48 ` [pve-devel] [PATCH proxmox-apt 3/3] check suites: add special check for Debian security repository Fabian Ebner
2022-02-03  8:02 ` [pve-devel] applied-series: [PATCH proxmox-apt 1/3] upgrade to edition 2021 Wolfgang Bumiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220118124822.87502-2-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal