summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/text/shift.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-01-10 17:54:11 +0100
committerGitHub <noreply@github.com>2025-01-10 16:54:11 +0000
commit6b9b78596a6103dfbcadafaeb03eda624da5306a (patch)
tree073a9e31f504634290337c20432ea13dc7a8953d /crates/typst-library/src/text/shift.rs
parent9473aface183feaf48601c5264c3604f5798169e (diff)
Don't generate accessors for required fields (#5680)
Diffstat (limited to 'crates/typst-library/src/text/shift.rs')
-rw-r--r--crates/typst-library/src/text/shift.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/typst-library/src/text/shift.rs b/crates/typst-library/src/text/shift.rs
index 9723bbf0..3eec0758 100644
--- a/crates/typst-library/src/text/shift.rs
+++ b/crates/typst-library/src/text/shift.rs
@@ -50,7 +50,7 @@ pub struct SubElem {
impl Show for Packed<SubElem> {
#[typst_macros::time(name = "sub", span = self.span())]
fn show(&self, engine: &mut Engine, styles: StyleChain) -> SourceResult<Content> {
- let body = self.body().clone();
+ let body = self.body.clone();
if self.typographic(styles) {
if let Some(text) = convert_script(&body, true) {
@@ -109,7 +109,7 @@ pub struct SuperElem {
impl Show for Packed<SuperElem> {
#[typst_macros::time(name = "super", span = self.span())]
fn show(&self, engine: &mut Engine, styles: StyleChain) -> SourceResult<Content> {
- let body = self.body().clone();
+ let body = self.body.clone();
if self.typographic(styles) {
if let Some(text) = convert_script(&body, false) {
@@ -132,9 +132,9 @@ fn convert_script(content: &Content, sub: bool) -> Option<EcoString> {
Some(' '.into())
} else if let Some(elem) = content.to_packed::<TextElem>() {
if sub {
- elem.text().chars().map(to_subscript_codepoint).collect()
+ elem.text.chars().map(to_subscript_codepoint).collect()
} else {
- elem.text().chars().map(to_superscript_codepoint).collect()
+ elem.text.chars().map(to_superscript_codepoint).collect()
}
} else if let Some(sequence) = content.to_packed::<SequenceElem>() {
sequence