Skip to content

Commit

Permalink
port: Allow creating an empty set.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Dec 11, 2023
1 parent 627ea86 commit aa1f975
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion all-is-cubes-port/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub async fn export_to_path(
}

/// Selection of the data to be exported.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Default)]
pub struct ExportSet {
/// `PartialUniverse` is defined in the `all_is_cubes` crate so that it can get access
/// to the same serialization helpers as `Universe` and be guaranteed to serialize the
Expand All @@ -114,6 +114,11 @@ pub struct ExportSet {
}

impl ExportSet {
/// Set containing no elements.
pub fn empty() -> Self {
Self::default()
}

/// Construct an [`ExportSet`] specifying exporting all members of the universe
/// (insofar as that is possible).
///
Expand Down

0 comments on commit aa1f975

Please sign in to comment.