File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -116,10 +116,7 @@ impl GltfDataDestination {
116
116
// TODO: Only do this if we exceed the in-memory limit?
117
117
let unique_file_suffix: String = {
118
118
let mut suffix_uses = self . 0 . suffix_uses . lock ( ) . map_err ( |_| {
119
- io:: Error :: new (
120
- io:: ErrorKind :: Other ,
121
- "previous panic while using GltfDataDestination" ,
122
- )
119
+ io:: Error :: other ( "previous panic while using GltfDataDestination" )
123
120
} ) ?;
124
121
make_unique_name ( proposed_file_name, & mut suffix_uses)
125
122
} ;
@@ -259,10 +256,9 @@ impl io::Write for SwitchingWriter {
259
256
let n = buffer. write ( bytes) ?;
260
257
if buffer. len ( ) > limit {
261
258
let path = path. as_ref ( ) . ok_or_else ( || {
262
- io:: Error :: new (
263
- io:: ErrorKind :: Other ,
264
- format ! ( "no destination was provided for glTF buffers > {limit} bytes" ) ,
265
- )
259
+ io:: Error :: other ( format ! (
260
+ "no destination was provided for glTF buffers > {limit} bytes"
261
+ ) )
266
262
} ) ?;
267
263
// TODO: refuse to overwrite existing files unless we are also overwriting a corresponding .gltf
268
264
let file = File :: create ( path) ?;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ pub(crate) fn import_native_json(
24
24
detail : if error. is_eof ( ) || error. is_io ( ) {
25
25
ImportErrorKind :: Read {
26
26
path : None ,
27
- error : io:: Error :: new ( io :: ErrorKind :: Other , error) ,
27
+ error : io:: Error :: other ( error) ,
28
28
}
29
29
} else {
30
30
ImportErrorKind :: Parse ( Box :: new ( error) )
@@ -43,7 +43,7 @@ pub(crate) async fn export_native_json(
43
43
let ExportSet { contents } = source;
44
44
serde_json:: to_writer ( destination, & contents) . map_err ( |error| {
45
45
// TODO: report non-IO errors distinctly
46
- ExportError :: Write ( io:: Error :: new ( io :: ErrorKind :: Other , error) )
46
+ ExportError :: Write ( io:: Error :: other ( error) )
47
47
} ) ?;
48
48
progress. finish ( ) . await ;
49
49
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments