diff options
Diffstat (limited to 'crates/typst-library/src/foundations/content/packed.rs')
| -rw-r--r-- | crates/typst-library/src/foundations/content/packed.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crates/typst-library/src/foundations/content/packed.rs b/crates/typst-library/src/foundations/content/packed.rs index 71bb66a9..e9916262 100644 --- a/crates/typst-library/src/foundations/content/packed.rs +++ b/crates/typst-library/src/foundations/content/packed.rs @@ -64,6 +64,16 @@ impl<T: NativeElement> Packed<T> { self.0 } + /// Pack back into a reference to content. + pub fn pack_ref(&self) -> &Content { + &self.0 + } + + /// Pack back into a mutable reference to content. + pub fn pack_mut(&mut self) -> &mut Content { + &mut self.0 + } + /// Extract the raw underlying element. pub fn unpack(self) -> T { // This function doesn't yet need owned self, but might in the future. @@ -94,10 +104,6 @@ impl<T: NativeElement> Packed<T> { pub fn set_location(&mut self, location: Location) { self.0.set_location(location); } - - pub fn as_content(&self) -> &Content { - &self.0 - } } impl<T: NativeElement> AsRef<T> for Packed<T> { |
