all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: Wolfgang Bumiller <w.bumiller@proxmox.com>
Cc: pdm-devel@lists.proxmox.com
Subject: Re: [pdm-devel] [PATCH proxmox 1/3] section-config: make write_section_config parameter more generic
Date: Wed, 23 Apr 2025 11:35:13 +0200	[thread overview]
Message-ID: <vcbx5aytav3kfe7aajehcosibdqiavo3swnex3t6tgpf5p3kxa@xnbt64jnikki> (raw)
In-Reply-To: <gzpgygnjf6x3g3ba5kxuc2cuugfb7oim7evmpxn73kdqt3agfx@og2rsxkx23t4>

On 15.04.2025 08:44, Wolfgang Bumiller wrote:
>style nit
>
>On Mon, Apr 14, 2025 at 02:00:43PM +0200, Gabriel Goller wrote:
>> The underlying function which gets called by `write_section_config` also
>> takes a `impl AsRef<Path>` and in some cases we do pass a path, so
>> taking the same parameter is better.
>>
>> Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
>> ---
>>  proxmox-section-config/src/typed.rs | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/proxmox-section-config/src/typed.rs b/proxmox-section-config/src/typed.rs
>> index 31e8e4b2e546..a25798e8a29b 100644
>> --- a/proxmox-section-config/src/typed.rs
>> +++ b/proxmox-section-config/src/typed.rs
>> @@ -1,6 +1,7 @@
>>  //! Support for `enum` typed section configs.
>>
>>  use std::collections::HashMap;
>> +use std::path::Path;
>>
>>  use anyhow::Error;
>>  use serde::{de::DeserializeOwned, Serialize};
>> @@ -90,7 +91,7 @@ pub trait ApiSectionDataEntry: Sized {
>>      }
>>
>>      /// Provided. Shortcut for `Self::section_config().write(filename, &data.try_into()?)`.
>> -    fn write_section_config(filename: &str, data: &SectionConfigData<Self>) -> Result<String, Error>
>> +    fn write_section_config(filename: impl AsRef<Path>, data: &SectionConfigData<Self>) -> Result<String, Error>
>
>- This is now too long (missing `fmt` call?)
>- I'd like to avoid too many `impl` parameters as they very quickly lead
>  to very long lines, particularly...
>
>>      where
>
>...since we already have a `where` section here. With `filename: P` the
>signature still fits in into a single line with
>    P: AsRef<Path>,
>here

Oops, forgot to run cargo fmt :)
Fixed it.


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  reply	other threads:[~2025-04-23  9:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 12:00 [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] Remove direct access to SectionConfigData<T> sections Gabriel Goller
2025-04-14 12:00 ` [pdm-devel] [PATCH proxmox 1/3] section-config: make write_section_config parameter more generic Gabriel Goller
2025-04-15  6:44   ` Wolfgang Bumiller
2025-04-23  9:35     ` Gabriel Goller [this message]
2025-04-14 12:00 ` [pdm-devel] [PATCH proxmox 2/3] section-config: remove DerefMut and make underlying HashMap private Gabriel Goller
2025-04-15  8:29   ` Wolfgang Bumiller
2025-04-23  9:40     ` Gabriel Goller
2025-04-15  8:42   ` Wolfgang Bumiller
2025-04-23  9:44     ` Gabriel Goller
2025-04-14 12:00 ` [pdm-devel] [PATCH proxmox 3/3] section-config: add lookup and convert_to_typed_array helpers Gabriel Goller
2025-04-15  8:39   ` Wolfgang Bumiller
2025-04-23 10:00     ` Gabriel Goller
2025-04-14 12:00 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] remotes: remove direct access on underlying sections HashMap Gabriel Goller

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=vcbx5aytav3kfe7aajehcosibdqiavo3swnex3t6tgpf5p3kxa@xnbt64jnikki \
    --to=g.goller@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    --cc=w.bumiller@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal