[pbs-devel] [PATCH proxmox-backup v2 09/12] examples/tests: add missing generics
Hannes Laimer
h.laimer at proxmox.com
Mon May 26 16:14:42 CEST 2025
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
pbs-datastore/examples/ls-snapshots.rs | 4 ++--
tests/prune.rs | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/pbs-datastore/examples/ls-snapshots.rs b/pbs-datastore/examples/ls-snapshots.rs
index 2eeea489..cf860a05 100644
--- a/pbs-datastore/examples/ls-snapshots.rs
+++ b/pbs-datastore/examples/ls-snapshots.rs
@@ -2,7 +2,7 @@ use std::path::PathBuf;
use anyhow::{bail, Error};
-use pbs_datastore::DataStore;
+use pbs_datastore::{chunk_store::Read as R, DataStore};
fn run() -> Result<(), Error> {
let base: PathBuf = match std::env::args().nth(1) {
@@ -18,7 +18,7 @@ fn run() -> Result<(), Error> {
None => None,
};
- let store = unsafe { DataStore::open_path("", base, None)? };
+ let store = unsafe { DataStore::<R>::open_path("", base, None)? };
for ns in store.recursive_iter_backup_ns_ok(Default::default(), max_depth)? {
println!("found namespace store:/{}", ns);
diff --git a/tests/prune.rs b/tests/prune.rs
index b11449ca..02de1078 100644
--- a/tests/prune.rs
+++ b/tests/prune.rs
@@ -4,10 +4,10 @@ use anyhow::Error;
use pbs_api_types::{PruneJobOptions, MANIFEST_BLOB_NAME};
use pbs_datastore::prune::compute_prune_info;
-use pbs_datastore::{BackupDir, BackupInfo};
+use pbs_datastore::{chunk_store::Read as R, BackupDir, BackupInfo};
fn get_prune_list(
- list: Vec<BackupInfo>,
+ list: Vec<BackupInfo<R>>,
return_kept: bool,
options: &PruneJobOptions,
) -> Vec<PathBuf> {
@@ -27,7 +27,7 @@ fn get_prune_list(
.collect()
}
-fn create_info(snapshot: &str, partial: bool) -> BackupInfo {
+fn create_info(snapshot: &str, partial: bool) -> BackupInfo<R> {
let backup_dir = BackupDir::new_test(snapshot.parse().unwrap());
let mut files = Vec::new();
@@ -43,7 +43,7 @@ fn create_info(snapshot: &str, partial: bool) -> BackupInfo {
}
}
-fn create_info_protected(snapshot: &str, partial: bool) -> BackupInfo {
+fn create_info_protected(snapshot: &str, partial: bool) -> BackupInfo<R> {
let mut info = create_info(snapshot, partial);
info.protected = true;
info
--
2.39.5
More information about the pbs-devel
mailing list