mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Merge a3a345147705ba3eb3d8032b8eadc48d3085a933 into 9b09146a6b5e936966ed7ee73bce9dd2df3810ae
This commit is contained in:
commit
7956e06ab6
@ -414,7 +414,7 @@ impl Content {
|
||||
/// Elements produced in `show` rules will not be included in the results.
|
||||
pub fn query(&self, selector: Selector) -> Vec<Content> {
|
||||
let mut results = Vec::new();
|
||||
self.traverse(&mut |element| -> ControlFlow<()> {
|
||||
let _ = self.traverse(&mut |element| -> ControlFlow<()> {
|
||||
if selector.matches(&element, None) {
|
||||
results.push(element);
|
||||
}
|
||||
@ -441,7 +441,7 @@ impl Content {
|
||||
/// Extracts the plain text of this content.
|
||||
pub fn plain_text(&self) -> EcoString {
|
||||
let mut text = EcoString::new();
|
||||
self.traverse(&mut |element| -> ControlFlow<()> {
|
||||
let _ = self.traverse(&mut |element| -> ControlFlow<()> {
|
||||
if let Some(textable) = element.with::<dyn PlainText>() {
|
||||
textable.plain_text(&mut text);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user