From aa1f9756a1d113185d7d7f0e79001d3462e2387f Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Mon, 11 Dec 2023 13:36:40 -0800 Subject: [PATCH] port: Allow creating an empty set. --- all-is-cubes-port/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/all-is-cubes-port/src/lib.rs b/all-is-cubes-port/src/lib.rs index 1ac8d8bcd..8ef4d176a 100644 --- a/all-is-cubes-port/src/lib.rs +++ b/all-is-cubes-port/src/lib.rs @@ -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 @@ -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). ///