File tree Expand file tree Collapse file tree 5 files changed +11
-13
lines changed Expand file tree Collapse file tree 5 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 49
49
run : cargo package --manifest-path mupdf-sys/Cargo.toml
50
50
51
51
test-wasm :
52
- name : Test WASM Emscripten
52
+ name : Test Suite ( Emscripten)
53
53
runs-on : ubuntu-latest
54
54
steps :
55
55
- uses : actions/checkout@v3
58
58
fetch-depth : 500
59
59
- uses : dtolnay/rust-toolchain@stable
60
60
with :
61
- targets : wasm32-unknown-unknown
61
+ targets : wasm32-unknown-emscripten
62
62
- uses : mymindstorm/setup-emsdk@v14
63
63
64
64
- run : cargo test --target wasm32-unknown-emscripten --features serde
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ fn find_clang_sysroot(target: &Target) -> Result<Option<String>> {
138
138
"Using emscripten requires the EMSDK environment variable to be set" . to_owned ( )
139
139
}
140
140
_ => {
141
- format ! ( "Invalid EMSDK environment variable: {}" , e )
141
+ format ! ( "Invalid EMSDK environment variable: {e}" )
142
142
}
143
143
} ) ?;
144
144
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ impl ParseCallbacks for DocsCallbacks {
40
40
return None ;
41
41
}
42
42
43
- let name = format ! ( "{}_{}" , enum_name , original_variant_name ) ;
43
+ let name = format ! ( "{enum_name }_{original_variant_name}" ) ;
44
44
self . full_names
45
45
. borrow_mut ( )
46
46
. insert ( original_variant_name. to_owned ( ) , name) ;
@@ -90,21 +90,21 @@ impl ParseCallbacks for DocsCallbacks {
90
90
let mut line = self . types . replace_all ( & line, |c : & regex:: Captures | {
91
91
let name = & c[ 0 ] ;
92
92
if name. contains ( '*' ) {
93
- return format ! ( "`{}`" , name ) ;
93
+ return format ! ( "`{name }`" ) ;
94
94
}
95
95
96
96
let full_names = self . full_names . borrow ( ) ;
97
97
if let Some ( full_name) = full_names. get ( name) {
98
- return format ! ( "[`{}`]({})" , name , full_name ) ;
98
+ return format ! ( "[`{name }`]({full_name })" ) ;
99
99
}
100
100
101
101
if let Some ( short_name) = name. strip_suffix ( "s" ) {
102
102
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" ) ;
104
104
}
105
105
}
106
106
107
- format ! ( "[`{}`]" , name )
107
+ format ! ( "[`{name }`]" )
108
108
} ) ;
109
109
110
110
if let Some ( ( first, rest) ) = line. split_once ( ": " ) {
Original file line number Diff line number Diff line change @@ -99,15 +99,13 @@ impl Buffer {
99
99
100
100
impl io:: Read for Buffer {
101
101
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)
104
103
}
105
104
}
106
105
107
106
impl io:: Write for Buffer {
108
107
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)
111
109
}
112
110
113
111
fn flush ( & mut self ) -> io:: Result < ( ) > {
Original file line number Diff line number Diff line change @@ -351,7 +351,7 @@ impl Write for PdfObject {
351
351
let mut fz_buf = Buffer :: with_capacity ( len) ;
352
352
fz_buf. write ( buf) ?;
353
353
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 ) ?;
355
355
Ok ( len)
356
356
}
357
357
You can’t perform that action at this time.
0 commit comments