refactor: rename leading to a more appropriate name

This commit is contained in:
Tobias Schmitz 2025-05-06 10:54:49 +02:00
parent 112ae858ea
commit 11c2049ddb
No known key found for this signature in database
3 changed files with 9 additions and 11 deletions

View File

@ -259,12 +259,11 @@ impl Show for Packed<EnumElem> {
.spanned(self.span()); .spanned(self.span());
if tight { if tight {
let leading = self let spacing = self
.spacing(styles) .spacing(styles)
.unwrap_or_else(|| ParElem::leading_in(styles).into()); .unwrap_or_else(|| ParElem::leading_in(styles).into());
let spacing = let v = VElem::new(spacing.into()).with_weak(true).with_attach(true).pack();
VElem::new(leading.into()).with_weak(true).with_attach(true).pack(); realized = v + realized;
realized = spacing + realized;
} }
Ok(realized) Ok(realized)

View File

@ -166,12 +166,11 @@ impl Show for Packed<ListElem> {
.spanned(self.span()); .spanned(self.span());
if tight { if tight {
let leading = self let spacing = self
.spacing(styles) .spacing(styles)
.unwrap_or_else(|| ParElem::leading_in(styles).into()); .unwrap_or_else(|| ParElem::leading_in(styles).into());
let spacing = let v = VElem::new(spacing.into()).with_weak(true).with_attach(true).pack();
VElem::new(leading.into()).with_weak(true).with_attach(true).pack(); realized = v + realized;
realized = spacing + realized;
} }
Ok(realized) Ok(realized)

View File

@ -189,15 +189,15 @@ impl Show for Packed<TermsElem> {
.styled(TermsElem::set_within(true)); .styled(TermsElem::set_within(true));
if tight { if tight {
let leading = self let spacing = self
.spacing(styles) .spacing(styles)
.unwrap_or_else(|| ParElem::leading_in(styles).into()); .unwrap_or_else(|| ParElem::leading_in(styles).into());
let spacing = VElem::new(leading.into()) let v = VElem::new(spacing.into())
.with_weak(true) .with_weak(true)
.with_attach(true) .with_attach(true)
.pack() .pack()
.spanned(span); .spanned(span);
realized = spacing + realized; realized = v + realized;
} }
Ok(realized) Ok(realized)