@@ -321,13 +321,13 @@ impl JsonMutexDB {
321321 let mut buffered_writer = BufWriter :: new ( writer) ;
322322 if pretty {
323323 serde_json:: to_writer_pretty ( & mut buffered_writer, data_to_save)
324- . map_err ( |e| DbError :: Io ( IoError :: new ( ErrorKind :: Other , e. to_string ( ) ) ) ) ?;
324+ . map_err ( |e| DbError :: Io ( IoError :: other ( e. to_string ( ) ) ) ) ?;
325325 } else if fast_serialization {
326326 simd_json:: to_writer ( & mut buffered_writer, data_to_save)
327- . map_err ( |e| DbError :: Io ( IoError :: new ( ErrorKind :: Other , format ! ( "{e:?}" ) ) ) ) ?;
327+ . map_err ( |e| DbError :: Io ( IoError :: other ( format ! ( "{e:?}" ) ) ) ) ?;
328328 } else {
329329 serde_json:: to_writer ( & mut buffered_writer, data_to_save)
330- . map_err ( |e| DbError :: Io ( IoError :: new ( ErrorKind :: Other , e. to_string ( ) ) ) ) ?;
330+ . map_err ( |e| DbError :: Io ( IoError :: other ( e. to_string ( ) ) ) ) ?;
331331 }
332332 buffered_writer. flush ( ) ?; // Ensure buffer is flushed
333333 Ok ( ( ) )
@@ -352,10 +352,10 @@ impl JsonMutexDB {
352352
353353 // Persist atomically (consumes temp_file)
354354 temp_file. persist ( & final_path) . map_err ( |e| {
355- DbError :: Io ( IoError :: new (
356- ErrorKind :: Other ,
357- format ! ( "Failed to atomically rename temp file: {}" , e. error) ,
358- ) )
355+ DbError :: Io ( IoError :: other ( format ! (
356+ "Failed to atomically rename temp file: {}" ,
357+ e. error
358+ ) ) )
359359 } ) ?;
360360 } else {
361361 // Non-atomic: Create/truncate target file directly
0 commit comments