public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Lukas Wagner <l.wagner@proxmox.com>
Cc: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] applied: [PATCH v2 proxmox] clippy fix: casting to the same type is unnecessary
Date: Tue, 8 Aug 2023 11:48:23 +0200	[thread overview]
Message-ID: <ztqrdmypjlzou65dguaseszxwhrroml7vk3qfxbyck6md27l4d@e2jntse3efwd> (raw)
In-Reply-To: <20230808094454.218381-1-l.wagner@proxmox.com>

applied, thanks

On Tue, Aug 08, 2023 at 11:44:54AM +0200, Lukas Wagner wrote:
> See: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
> 
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> ---
>  proxmox-time/src/posix.rs | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/proxmox-time/src/posix.rs b/proxmox-time/src/posix.rs
> index 3201d6a..6157f8b 100644
> --- a/proxmox-time/src/posix.rs
> +++ b/proxmox-time/src/posix.rs
> @@ -137,6 +137,10 @@ pub fn strftime(format: &str, t: &libc::tm) -> Result<String, Error> {
>          // -1,, it's unsigned
>          bail!("strftime failed");
>      }
> +
> +    // `res` is a `libc::size_t`, which on a different target architecture might not be directly
> +    // assignable to a `usize`. Thus, we actually want a cast here.
> +    #[allow(clippy::unnecessary_cast)]
>      let len = res as usize;
>  
>      if len == 0 {
> -- 
> 2.39.2




      reply	other threads:[~2023-08-08  9:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  9:44 [pbs-devel] " Lukas Wagner
2023-08-08  9:48 ` Wolfgang Bumiller [this message]

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=ztqrdmypjlzou65dguaseszxwhrroml7vk3qfxbyck6md27l4d@e2jntse3efwd \
    --to=w.bumiller@proxmox.com \
    --cc=l.wagner@proxmox.com \
    --cc=pbs-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