diff options
| author | Laurenz <laurmaedje@gmail.com> | 2025-01-23 12:50:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-23 11:50:51 +0000 |
| commit | 52ee33a275063369673d8802fb820db3825a661f (patch) | |
| tree | e4f8ca45e7b9efd608babba5aed85042f8994a08 /crates/typst-utils/src | |
| parent | 1bd8ff0e0fa7966f4bd2a4426241781bed168df7 (diff) | |
Rework outline (#5735)
Diffstat (limited to 'crates/typst-utils/src')
| -rw-r--r-- | crates/typst-utils/src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/typst-utils/src/lib.rs b/crates/typst-utils/src/lib.rs index d392e409..f3fe79d2 100644 --- a/crates/typst-utils/src/lib.rs +++ b/crates/typst-utils/src/lib.rs @@ -276,6 +276,15 @@ pub trait Get<Index> { fn set(&mut self, index: Index, component: Self::Component) { *self.get_mut(index) = component; } + + /// Builder-style method for setting a component. + fn with(mut self, index: Index, component: Self::Component) -> Self + where + Self: Sized, + { + self.set(index, component); + self + } } /// A numeric type. |
