Switch datasets from Vec to HashSet
This commit is contained in:
@@ -71,7 +71,7 @@ impl JobBuilder {
|
|||||||
|
|
||||||
pub fn build(self) -> Result<Job, String> {
|
pub fn build(self) -> Result<Job, String> {
|
||||||
let mut job = Job {
|
let mut job = Job {
|
||||||
datasets: vec![],
|
datasets: HashSet::new(),
|
||||||
target: self.target,
|
target: self.target,
|
||||||
source_zfs_command: self.source_zfs_command,
|
source_zfs_command: self.source_zfs_command,
|
||||||
target_zfs_command: self.target_zfs_command,
|
target_zfs_command: self.target_zfs_command,
|
||||||
@@ -79,7 +79,7 @@ impl JobBuilder {
|
|||||||
retain: self.retain,
|
retain: self.retain,
|
||||||
sender: self.sender,
|
sender: self.sender,
|
||||||
};
|
};
|
||||||
let mut datasets: Vec<String> = vec![];
|
let mut datasets: HashSet<String> = HashSet::new();
|
||||||
for source in &self.sources {
|
for source in &self.sources {
|
||||||
let recurse = source.ends_with("/...");
|
let recurse = source.ends_with("/...");
|
||||||
let source = source.trim_end_matches("/...");
|
let source = source.trim_end_matches("/...");
|
||||||
@@ -104,7 +104,7 @@ impl JobBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct Job {
|
pub struct Job {
|
||||||
datasets: Vec<String>,
|
datasets: HashSet<String>,
|
||||||
target: String,
|
target: String,
|
||||||
source_zfs_command: Vec<String>,
|
source_zfs_command: Vec<String>,
|
||||||
target_zfs_command: Vec<String>,
|
target_zfs_command: Vec<String>,
|
||||||
|
|||||||
Reference in New Issue
Block a user