Skip to content

Commit 9fc128c

Browse files
ryanoneillclaude
andcommitted
Fix clippy io_other_error lint in Rust 1.94
Use std::io::Error::other() instead of std::io::Error::new(ErrorKind::Other, ...) in doc tests and unit tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6f4c91b commit 9fc128c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl EnvisionError {
164164
/// assert_eq!(err.to_string(), "other error: something went wrong");
165165
///
166166
/// // Works with any error type
167-
/// let io_err = std::io::Error::new(std::io::ErrorKind::Other, "disk full");
167+
/// let io_err = std::io::Error::other("disk full");
168168
/// let err = EnvisionError::other(io_err);
169169
/// assert!(err.to_string().contains("disk full"));
170170
/// ```
@@ -390,7 +390,7 @@ mod tests {
390390

391391
#[test]
392392
fn other_error_source() {
393-
let io_err = std::io::Error::new(std::io::ErrorKind::Other, "inner error");
393+
let io_err = std::io::Error::other("inner error");
394394
let err = EnvisionError::Other(Box::new(io_err));
395395
let source = std::error::Error::source(&err);
396396
assert!(source.is_some());
@@ -406,7 +406,7 @@ mod tests {
406406

407407
#[test]
408408
fn other_convenience_constructor_with_io_error() {
409-
let io_err = std::io::Error::new(std::io::ErrorKind::Other, "disk full");
409+
let io_err = std::io::Error::other("disk full");
410410
let err = EnvisionError::other(io_err);
411411
assert!(matches!(err, EnvisionError::Other(_)));
412412
assert!(err.to_string().contains("disk full"));

0 commit comments

Comments
 (0)