[pbs-devel] [PATCH proxmox-backup 1/2] api types: version: add helper for min version checks

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Nov 28 14:18:55 CET 2024


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.




More information about the pbs-devel mailing list