presentations don't need to create the slide at all if not in range
Some checks are pending
/ test (push) Waiting to run
Some checks are pending
/ test (push) Waiting to run
This commit is contained in:
parent
001650a656
commit
3c1c76d41c
1 changed files with 9 additions and 8 deletions
|
|
@ -204,7 +204,14 @@ impl ServiceTrait for Presentation {
|
|||
let pages = document.pages().into_diagnostic()?;
|
||||
debug!(?pages);
|
||||
let pages: Vec<Handle> = pages
|
||||
.filter_map(|page| {
|
||||
.enumerate()
|
||||
.filter_map(|(index, page)| {
|
||||
if (index as i32) < starting_index {
|
||||
return None;
|
||||
} else if (index as i32) > ending_index {
|
||||
return None;
|
||||
};
|
||||
|
||||
let Some(page) = page.ok() else {
|
||||
return None;
|
||||
};
|
||||
|
|
@ -227,13 +234,7 @@ impl ServiceTrait for Presentation {
|
|||
.collect();
|
||||
|
||||
let mut slides: Vec<Slide> = vec![];
|
||||
for (index, page) in pages.into_iter().enumerate() {
|
||||
if (index as i32) < starting_index {
|
||||
continue;
|
||||
} else if (index as i32) > ending_index {
|
||||
continue;
|
||||
};
|
||||
|
||||
for (index, page) in pages.into_iter() {
|
||||
let slide = SlideBuilder::new()
|
||||
.background(
|
||||
Background::try_from(self.path.clone())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue