From 5b0b4237ccd2aa1b2c651f7f06ec33251ba22d7b Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 8 Nov 2022 13:42:26 +0100 Subject: [PATCH] Add `MaybePartial::global_form` --- crates/fj-kernel/src/partial/maybe_partial.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/fj-kernel/src/partial/maybe_partial.rs b/crates/fj-kernel/src/partial/maybe_partial.rs index ce1ea530c..ecc6ad9ee 100644 --- a/crates/fj-kernel/src/partial/maybe_partial.rs +++ b/crates/fj-kernel/src/partial/maybe_partial.rs @@ -224,6 +224,14 @@ impl MaybePartial { Self::Partial(partial) => partial.surface(), } } + + /// Access the global form + pub fn global_form(&self) -> MaybePartial { + match self { + Self::Full(full) => full.global_form().clone().into(), + Self::Partial(partial) => partial.global_form(), + } + } } impl MaybePartial {