Skip to content

Commit 8f9e7c9

Browse files
committed
style: cargo fmt
1 parent c37772c commit 8f9e7c9

3 files changed

Lines changed: 19 additions & 20 deletions

File tree

src/docx/parser.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,10 +1410,8 @@ impl DocxParser {
14101410
// Track as vMerge origin: row_idx = table.rows.len() (index
14111411
// the current row will have once pushed in </w:tr> handler)
14121412
if let Some(ref row) = current_row {
1413-
vmerge_origins.insert(
1414-
col_cursor,
1415-
(table.rows.len(), row.cells.len()),
1416-
);
1413+
vmerge_origins
1414+
.insert(col_cursor, (table.rows.len(), row.cells.len()));
14171415
}
14181416
if let Some(ref mut row) = current_row {
14191417
row.cells.push(cell);
@@ -3027,7 +3025,8 @@ mod tests {
30273025
);
30283026
// Row 1: only cell C (continuation cell excluded)
30293027
assert_eq!(
3030-
table.rows[1].cells.len(), 1,
3028+
table.rows[1].cells.len(),
3029+
1,
30313030
"continuation cell must be excluded from row 1"
30323031
);
30333032
assert_eq!(table.rows[1].cells[0].plain_text(), "C");

src/pptx/parser.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,19 @@ impl PptxParser {
225225
format!("ppt/{}", target)
226226
};
227227

228-
let slide_full_rels =
229-
self.container.read_optional_relationships_for_part(&slide_path)?;
228+
let slide_full_rels = self
229+
.container
230+
.read_optional_relationships_for_part(&slide_path)?;
230231
let inherited_phs = self.build_inherited_phs(&slide_path, &slide_full_rels);
231232
let slide_rels = slide_full_rels.into_targets_by_id();
232233

233234
if let Some(xml) = self.container.read_xml_optional(&slide_path)? {
234-
let blocks =
235-
self.parse_slide_content_with_rels(&xml, &slide_rels, &slide_path, &inherited_phs)?;
235+
let blocks = self.parse_slide_content_with_rels(
236+
&xml,
237+
&slide_rels,
238+
&slide_path,
239+
&inherited_phs,
240+
)?;
236241
for block in blocks {
237242
section.add_block(block);
238243
}
@@ -939,18 +944,16 @@ impl PptxParser {
939944
for attr in e.attributes().flatten() {
940945
match attr.key.local_name().as_ref() {
941946
b"type" => {
942-
ph_type =
943-
String::from_utf8_lossy(&attr.value).into_owned();
947+
ph_type = String::from_utf8_lossy(&attr.value).into_owned();
944948
current_heading = match ph_type.as_str() {
945949
"title" | "ctrTitle" => HeadingLevel::H1,
946950
"subTitle" => HeadingLevel::H2,
947951
_ => HeadingLevel::None,
948952
};
949953
}
950954
b"idx" => {
951-
ph_idx = Some(
952-
String::from_utf8_lossy(&attr.value).into_owned(),
953-
);
955+
ph_idx =
956+
Some(String::from_utf8_lossy(&attr.value).into_owned());
954957
}
955958
_ => {}
956959
}
@@ -1405,8 +1408,7 @@ fn parse_placeholder_texts_from_xml(xml: &str) -> HashMap<String, Vec<Paragraph>
14051408
for attr in e.attributes().flatten() {
14061409
match attr.key.local_name().as_ref() {
14071410
b"type" => {
1408-
ph_type =
1409-
String::from_utf8_lossy(&attr.value).into_owned();
1411+
ph_type = String::from_utf8_lossy(&attr.value).into_owned();
14101412
current_heading = match ph_type.as_str() {
14111413
"title" | "ctrTitle" => HeadingLevel::H1,
14121414
"subTitle" => HeadingLevel::H2,
@@ -1445,8 +1447,7 @@ fn parse_placeholder_texts_from_xml(xml: &str) -> HashMap<String, Vec<Paragraph>
14451447
};
14461448
}
14471449
b"idx" => {
1448-
ph_idx =
1449-
Some(String::from_utf8_lossy(&attr.value).into_owned());
1450+
ph_idx = Some(String::from_utf8_lossy(&attr.value).into_owned());
14501451
}
14511452
_ => {}
14521453
}

src/render/markdown.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,8 +2097,7 @@ mod tests {
20972097
height: None,
20982098
});
20992099

2100-
let options =
2101-
RenderOptions::new().with_table_fallback(crate::render::TableFallback::Html);
2100+
let options = RenderOptions::new().with_table_fallback(crate::render::TableFallback::Html);
21022101
let html = render_table(&table, &options, &empty_resource_map());
21032102

21042103
assert!(

0 commit comments

Comments
 (0)