mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-01 23:51:46 -04:00
fmt
This commit is contained in:
+5
-1
@@ -169,7 +169,11 @@ pub async fn run_conversion_loop(
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
log::debug!("got converted page for num {} with results {:?}", page_info.page_num, page_info.result_rects);
|
log::debug!(
|
||||||
|
"got converted page for num {} with results {:?}",
|
||||||
|
page_info.page_num,
|
||||||
|
page_info.result_rects
|
||||||
|
);
|
||||||
|
|
||||||
// update the iteration to the iteration that we stole this image from
|
// update the iteration to the iteration that we stole this image from
|
||||||
*iteration = new_iter;
|
*iteration = new_iter;
|
||||||
|
|||||||
+15
-17
@@ -536,15 +536,14 @@ fn search_page(
|
|||||||
) -> Result<Vec<Quad>, mupdf::error::Error> {
|
) -> Result<Vec<Quad>, mupdf::error::Error> {
|
||||||
search_term
|
search_term
|
||||||
.map(|term| {
|
.map(|term| {
|
||||||
page.to_text_page(TextPageFlags::empty())
|
page.to_text_page(TextPageFlags::empty()).and_then(|page| {
|
||||||
.and_then(|page| {
|
let mut v = Vec::with_capacity(trusted_search_results);
|
||||||
let mut v = Vec::with_capacity(trusted_search_results);
|
page.search_cb(term, &mut v, |v, results| {
|
||||||
page.search_cb(term, &mut v, |v, results| {
|
v.extend(results.iter().cloned());
|
||||||
v.extend(results.iter().cloned());
|
SearchHitResponse::ContinueSearch
|
||||||
SearchHitResponse::ContinueSearch
|
|
||||||
})
|
|
||||||
.map(|_| v)
|
|
||||||
})
|
})
|
||||||
|
.map(|_| v)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.transpose()
|
.transpose()
|
||||||
.map(Option::unwrap_or_default)
|
.map(Option::unwrap_or_default)
|
||||||
@@ -552,15 +551,14 @@ fn search_page(
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn count_search_results(page: &Page, search_term: &str) -> Result<usize, mupdf::error::Error> {
|
fn count_search_results(page: &Page, search_term: &str) -> Result<usize, mupdf::error::Error> {
|
||||||
page.to_text_page(TextPageFlags::empty())
|
page.to_text_page(TextPageFlags::empty()).and_then(|page| {
|
||||||
.and_then(|page| {
|
let mut count = 0;
|
||||||
let mut count = 0;
|
page.search_cb(search_term, &mut count, |count, results| {
|
||||||
page.search_cb(search_term, &mut count, |count, results| {
|
*count += results.len();
|
||||||
*count += results.len();
|
SearchHitResponse::ContinueSearch
|
||||||
SearchHitResponse::ContinueSearch
|
})?;
|
||||||
})?;
|
Ok(count)
|
||||||
Ok(count)
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct PopOnNext<'a> {
|
struct PopOnNext<'a> {
|
||||||
|
|||||||
Reference in New Issue
Block a user