Skip empty AppliedPatchSets for sending changes.

This commit is contained in:
Lucien Greathouse
2022-08-03 17:19:23 -04:00
parent 2a6a8b42a6
commit 565c12405e
2 changed files with 11 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ pub struct PatchSet {
pub updated_instances: Vec<PatchUpdate>,
}
impl<'a> PatchSet {
impl PatchSet {
pub fn new() -> Self {
PatchSet {
removed_instances: Vec::new(),
@@ -76,6 +76,10 @@ impl AppliedPatchSet {
updated: Vec::new(),
}
}
pub fn is_empty(&self) -> bool {
self.removed.is_empty() && self.added.is_empty() && self.updated.is_empty()
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]