Skip to content

Commit 0a19589

Browse files
committed
fix ci
1 parent f3ca590 commit 0a19589

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl HwpReader {
4848
let mut section_idx = 0;
4949

5050
loop {
51-
let section_name = format!("BodyText/Section{}", section_idx);
51+
let section_name = format!("BodyText/Section{section_idx}");
5252
if !reader.stream_exists(&section_name) {
5353
break;
5454
}

src/parser/body_text.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ impl BodyTextParser {
8484
if let Some(para) = current_paragraph.take() {
8585
current_section.paragraphs.push(para);
8686
}
87-
match Paragraph::from_header_record(&record) {
88-
Ok(para) => current_paragraph = Some(para),
89-
Err(_) => {} // Skip invalid paragraph headers
87+
if let Ok(para) = Paragraph::from_header_record(&record) {
88+
current_paragraph = Some(para);
9089
}
90+
// Skip invalid paragraph headers
9191
}
9292
Some(HwpTag::ParaText) => {
9393
if let Some(ref mut para) = current_paragraph {

src/parser/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ impl FileHeader {
9797
let build = (self.version >> 8) & 0xFF;
9898
let revision = self.version & 0xFF;
9999

100-
format!("{}.{}.{}.{}", major, minor, build, revision)
100+
format!("{major}.{minor}.{build}.{revision}")
101101
}
102102
}

src/reader/cfb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ impl CfbReader<std::fs::File> {
1111
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self> {
1212
let file = std::fs::File::open(path)?;
1313
let cfb = CompoundFile::open(file)
14-
.map_err(|e| HwpError::Cfb(format!("Failed to open CFB: {}", e)))?;
14+
.map_err(|e| HwpError::Cfb(format!("Failed to open CFB: {e}")))?;
1515
Ok(Self { cfb })
1616
}
1717
}
1818

1919
impl<F: Read + Seek> CfbReader<F> {
2020
pub fn new(reader: F) -> Result<Self> {
2121
let cfb = CompoundFile::open(reader)
22-
.map_err(|e| HwpError::Cfb(format!("Failed to open CFB: {}", e)))?;
22+
.map_err(|e| HwpError::Cfb(format!("Failed to open CFB: {e}")))?;
2323
Ok(Self { cfb })
2424
}
2525

2626
pub fn read_stream(&mut self, path: &str) -> Result<Vec<u8>> {
2727
let mut stream = self
2828
.cfb
2929
.open_stream(path)
30-
.map_err(|e| HwpError::NotFound(format!("Stream '{}' not found: {}", path, e)))?;
30+
.map_err(|e| HwpError::NotFound(format!("Stream '{path}' not found: {e}")))?;
3131

3232
let mut buffer = Vec::new();
3333
stream.read_to_end(&mut buffer)?;

src/render/renderer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ impl RenderResult {
273273
stroke_width,
274274
} => {
275275
svg.push_str(&format!(
276-
r#"<rect x="{}" y="{}" width="{}" height="{}""#,
277-
x, y, width, height
276+
r#"<rect x="{x}" y="{y}" width="{width}" height="{height}""#
278277
));
279278

280279
if let Some(fill) = fill_color {

0 commit comments

Comments
 (0)