From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pbs-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id D0FC41FF16B
	for <inbox@lore.proxmox.com>; Thu, 28 Nov 2024 14:49:16 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id D19716620;
	Thu, 28 Nov 2024 14:49:18 +0100 (CET)
Message-ID: <95f86bb4-96c9-4bf4-8343-b6996ce72479@proxmox.com>
Date: Thu, 28 Nov 2024 14:49:14 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
 Proxmox Backup Server development discussion <pbs-devel@lists.proxmox.com>
References: <20241128124925.318298-1-c.ebner@proxmox.com>
 <8fb89fb5-0def-4b39-a30e-00193958bc16@proxmox.com>
 <f05f3cea-803d-4e2f-ae7c-8c5cd1cf39b4@proxmox.com>
 <0f9f1b28-f83f-459e-a2b8-4c5fa60d3562@proxmox.com>
Content-Language: en-US, de-DE
From: Christian Ebner <c.ebner@proxmox.com>
In-Reply-To: <0f9f1b28-f83f-459e-a2b8-4c5fa60d3562@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.030 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to
 Validity was blocked. See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more
 information.
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [pbs-devel] [PATCH proxmox-backup 1/2] api types: version: add
 helper for min version checks
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox Backup Server development discussion
 <pbs-devel@lists.proxmox.com>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: pbs-devel-bounces@lists.proxmox.com
Sender: "pbs-devel" <pbs-devel-bounces@lists.proxmox.com>

On 11/28/24 14:18, Thomas Lamprecht wrote:
> Am 28.11.24 um 14:14 schrieb Christian Ebner:
>> On 11/28/24 14:10, Thomas Lamprecht wrote:
>>> Why not impl the Ord trait here instead?
>>>
>>> Then the call-site could be
>>>
>>> let supports_prune_delete_stats = api_version >= ApiVersion::new(3, 2, 11, String::new());
>>
>> Ah, yes that's way nicer and allows also for exact version matching.
>>
>>> And maybe a separate type for the triple without the commit hash on which you
>>> also impl the same and then avoid that slightly confusing String::new() hack.
>>
>> Acked, will send a new version incorporating your feedback, thanks!
>>
> 
> Note that while I'm quite sure of the first thing the last thing was just a
> idea from top of my head, not sure how much it improves,  but maybe having
> a separate VersionTriple or SemanticVersion type might make a few things nicer
> to use.

Okay, well I was rather opting for dropping the `repoid` from 
`ApiVersion` instead of introducing another type, as that is currently 
not used and was just included for completeness. The `repoid` can 
already be obtained directly from the `ApiVersionInfo`, returned by the 
version api endpoint so this information is redundant anyways.


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