mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-01-20 14:03:53 +03:00
sync: push: use direct api version comparison in compatibility checks
Use the trait implementations of `ApiVersion` to perform operator based version comparisons. This makes the comparison more readable and reduces the risk for errors. No functional change intended. Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
00254d60e3
commit
0083e7ac05
@ -127,13 +127,11 @@ impl PushParameters {
|
|||||||
let api_version = ApiVersion::try_from(version_info)?;
|
let api_version = ApiVersion::try_from(version_info)?;
|
||||||
|
|
||||||
// push assumes namespace support on the remote side, fail early if missing
|
// push assumes namespace support on the remote side, fail early if missing
|
||||||
if api_version.major < 2 || (api_version.major == 2 && api_version.minor < 2) {
|
if api_version < ApiVersion::new(2, 2, 0) {
|
||||||
bail!("Unsupported remote api version, minimum v2.2 required");
|
bail!("Unsupported remote api version, minimum v2.2 required");
|
||||||
}
|
}
|
||||||
|
|
||||||
let supports_prune_delete_stats = api_version.major > 3
|
let supports_prune_delete_stats = api_version >= ApiVersion::new(3, 2, 11);
|
||||||
|| (api_version.major == 3 && api_version.minor >= 3)
|
|
||||||
|| (api_version.major == 3 && api_version.minor == 2 && api_version.release >= 11);
|
|
||||||
|
|
||||||
let target = PushTarget {
|
let target = PushTarget {
|
||||||
remote,
|
remote,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user