Skip to content

Commit f88f66f

Browse files
committed
Satisfy Rust 1.87 clippy
1 parent 5d0ecb6 commit f88f66f

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: cargo package --manifest-path mupdf-sys/Cargo.toml
5050

5151
test-wasm:
52-
name: Test WASM Emscripten
52+
name: Test Suite (Emscripten)
5353
runs-on: ubuntu-latest
5454
steps:
5555
- uses: actions/checkout@v3
@@ -58,7 +58,7 @@ jobs:
5858
fetch-depth: 500
5959
- uses: dtolnay/rust-toolchain@stable
6060
with:
61-
targets: wasm32-unknown-unknown
61+
targets: wasm32-unknown-emscripten
6262
- uses: mymindstorm/setup-emsdk@v14
6363

6464
- run: cargo test --target wasm32-unknown-emscripten --features serde

mupdf-sys/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fn find_clang_sysroot(target: &Target) -> Result<Option<String>> {
138138
"Using emscripten requires the EMSDK environment variable to be set".to_owned()
139139
}
140140
_ => {
141-
format!("Invalid EMSDK environment variable: {}", e)
141+
format!("Invalid EMSDK environment variable: {e}")
142142
}
143143
})?;
144144

mupdf-sys/docs.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl ParseCallbacks for DocsCallbacks {
4040
return None;
4141
}
4242

43-
let name = format!("{}_{}", enum_name, original_variant_name);
43+
let name = format!("{enum_name}_{original_variant_name}");
4444
self.full_names
4545
.borrow_mut()
4646
.insert(original_variant_name.to_owned(), name);
@@ -90,21 +90,21 @@ impl ParseCallbacks for DocsCallbacks {
9090
let mut line = self.types.replace_all(&line, |c: &regex::Captures| {
9191
let name = &c[0];
9292
if name.contains('*') {
93-
return format!("`{}`", name);
93+
return format!("`{name}`");
9494
}
9595

9696
let full_names = self.full_names.borrow();
9797
if let Some(full_name) = full_names.get(name) {
98-
return format!("[`{}`]({})", name, full_name);
98+
return format!("[`{name}`]({full_name})");
9999
}
100100

101101
if let Some(short_name) = name.strip_suffix("s") {
102102
if let Some(full_name) = full_names.get(short_name) {
103-
return format!("[`{}`]({})s", short_name, full_name);
103+
return format!("[`{short_name}`]({full_name})s");
104104
}
105105
}
106106

107-
format!("[`{}`]", name)
107+
format!("[`{name}`]")
108108
});
109109

110110
if let Some((first, rest)) = line.split_once(": ") {

src/buffer.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,13 @@ impl Buffer {
9999

100100
impl io::Read for Buffer {
101101
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
102-
self.read_bytes(buf)
103-
.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))
102+
self.read_bytes(buf).map_err(io::Error::other)
104103
}
105104
}
106105

107106
impl io::Write for Buffer {
108107
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
109-
self.write_bytes(buf)
110-
.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))
108+
self.write_bytes(buf).map_err(io::Error::other)
111109
}
112110

113111
fn flush(&mut self) -> io::Result<()> {

src/pdf/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ impl Write for PdfObject {
351351
let mut fz_buf = Buffer::with_capacity(len);
352352
fz_buf.write(buf)?;
353353
self.write_stream_buffer(&fz_buf)
354-
.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?;
354+
.map_err(io::Error::other)?;
355355
Ok(len)
356356
}
357357

0 commit comments

Comments
 (0)