public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>, Stefan Lendl <s.lendl@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 05/10] config: remove unnecessary pub in various methods in NetworkConfig
Date: Wed, 17 Jan 2024 10:50:30 +0100	[thread overview]
Message-ID: <5ce91b68-59a8-4ff7-a247-c433171e4451@proxmox.com> (raw)
In-Reply-To: <20240111155303.1072675-11-s.lendl@proxmox.com>



On 1/11/24 16:53, Stefan Lendl wrote:
> Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
> ---
>   pbs-config/src/network/mod.rs    | 10 +++++-----
>   pbs-config/src/network/parser.rs |  2 +-
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/pbs-config/src/network/mod.rs b/pbs-config/src/network/mod.rs
> index 971c1ebe..9ecc66b8 100644
> --- a/pbs-config/src/network/mod.rs
> +++ b/pbs-config/src/network/mod.rs
> @@ -251,7 +251,7 @@ impl NetworkConfig {
>       }
>   
>       /// Check if ports are used only once
> -    pub fn check_port_usage(&self) -> Result<(), Error> {
> +    fn check_port_usage(&self) -> Result<(), Error> {
>           let mut used_ports = HashMap::new();
>           let mut check_port_usage = |iface, ports: &Vec<String>| {
>               for port in ports.iter() {
> @@ -280,7 +280,7 @@ impl NetworkConfig {
>       }
>   
>       /// Check if child mtu is less or equal than parent mtu
> -    pub fn check_mtu(&self, parent_name: &str, child_name: &str) -> Result<(), Error> {
> +    fn check_mtu(&self, parent_name: &str, child_name: &str) -> Result<(), Error> {
>           let parent = self
>               .interfaces
>               .get(parent_name)
> @@ -320,7 +320,7 @@ impl NetworkConfig {
>       }
>   
>       /// Check if bond slaves exists
> -    pub fn check_bond_slaves(&self) -> Result<(), Error> {
> +    fn check_bond_slaves(&self) -> Result<(), Error> {
>           for (iface, interface) in self.interfaces.iter() {
>               if let Some(slaves) = &interface.slaves {
>                   for slave in slaves.iter() {
> @@ -348,7 +348,7 @@ impl NetworkConfig {
>       }
>   
>       /// Check if bridge ports exists
> -    pub fn check_bridge_ports(&self) -> Result<(), Error> {
> +    fn check_bridge_ports(&self) -> Result<(), Error> {
>           lazy_static! {
>               static ref VLAN_INTERFACE_REGEX: Regex = Regex::new(r"^(\S+)\.(\d+)$").unwrap();
>           }
> @@ -372,7 +372,7 @@ impl NetworkConfig {
>           Ok(())
>       }
>   
> -    pub fn write_config(&self, w: &mut dyn Write) -> Result<(), Error> {
> +    fn write_config(&self, w: &mut dyn Write) -> Result<(), Error> { >           self.check_port_usage()?;
>           self.check_bond_slaves()?;
>           self.check_bridge_ports()?;
> diff --git a/pbs-config/src/network/parser.rs b/pbs-config/src/network/parser.rs
> index 5a83e192..0c178d9b 100644
> --- a/pbs-config/src/network/parser.rs
> +++ b/pbs-config/src/network/parser.rs
> @@ -491,7 +491,7 @@ impl<R: BufRead> NetworkParser<R> {
>               .map_err(|err| format_err!("line {}: {}", self.line_nr, err))
>       }
>   
> -    pub fn _parse_interfaces(
> +    fn _parse_interfaces(

Maybe use this opportunity to name this method in a more idiomatic way?
The _ prefix is not really common in Rust ;)

>           &mut self,
>           existing_interfaces: Option<&HashMap<String, bool>>,
>       ) -> Result<NetworkConfig, Error> {

-- 
- Lukas




  reply	other threads:[~2024-01-17  9:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11 15:52 [pbs-devel] [PATCH widget-toolkit/proxmox-backup 00/10] Fix #3115: VLAN Network Interface Configuration Stefan Lendl
2024-01-11 15:52 ` [pbs-devel] [PATCH proxmox-backup 01/10] tests: move network tests to parser.rs Stefan Lendl
2024-01-11 15:52 ` [pbs-devel] [PATCH proxmox-backup 02/10] tests: rudimentary NetworkConfig.write_config tests Stefan Lendl
2024-01-11 15:52 ` [pbs-devel] [PATCH proxmox-backup 03/10] config: write vlan network interface Stefan Lendl
2024-01-17  9:50   ` Lukas Wagner
2024-01-11 15:53 ` [pbs-devel] [PATCH proxmox-backup 04/10] config: parse vlan interface from config Stefan Lendl
2024-01-11 15:53 ` [pbs-devel] [PATCH proxmox-backup 05/10] config: remove unnecessary pub in various methods in NetworkConfig Stefan Lendl
2024-01-17  9:50   ` Lukas Wagner [this message]
2024-01-11 15:53 ` [pbs-devel] [PATCH proxmox-backup 06/10] fmt: fix intendation in api macro Stefan Lendl
2024-01-11 15:53 ` [pbs-devel] [PATCH proxmox-backup 07/10] api: create and update vlan interfaces Stefan Lendl
2024-01-17  9:50   ` Lukas Wagner
2024-01-11 15:53 ` [pbs-devel] [PATCH proxmox-backup 08/10] refactor(api): simplify setting interface properties Stefan Lendl
2024-01-17  9:50   ` Lukas Wagner
2024-01-11 15:53 ` [pbs-devel] [PATCH proxmox-backup 09/10] ui: enable vlan widget Stefan Lendl
2024-01-11 15:53 ` [pbs-devel] [PATCH widget-toolkit 10/10] form: include VlanField from PVE Stefan Lendl
2024-01-11 16:01   ` Lukas Wagner
2024-01-17  9:50 ` [pbs-devel] [PATCH widget-toolkit/proxmox-backup 00/10] Fix #3115: VLAN Network Interface Configuration Lukas Wagner
2024-01-22 11:06 ` Stefan Lendl

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=5ce91b68-59a8-4ff7-a247-c433171e4451@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=s.lendl@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