diff options
| author | Jiahao XU <Jiahao_XU@outlook.com> | 2024-01-19 09:26:56 +1100 |
|---|---|---|
| committer | Jiahao XU <Jiahao_XU@outlook.com> | 2024-01-19 09:26:56 +1100 |
| commit | baa2cf5ea610d10be1e3cb13f7da4f2d752aa69a (patch) | |
| tree | a193d584e2e8e13cc4cdb9c8d2a505b87f398ce8 /library/std/src/io/error/tests.rs | |
| parent | c485ee71477a29041895c47cc441b364670f3772 (diff) | |
| download | rust-baa2cf5ea610d10be1e3cb13f7da4f2d752aa69a.tar.gz rust-baa2cf5ea610d10be1e3cb13f7da4f2d752aa69a.zip | |
Update `std::io::Error::downcast` return type
and update its doc according to decision made by rust libs-api team. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Diffstat (limited to 'library/std/src/io/error/tests.rs')
| -rw-r--r-- | library/std/src/io/error/tests.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/io/error/tests.rs b/library/std/src/io/error/tests.rs index 36d52aef03c..fc6db2825e8 100644 --- a/library/std/src/io/error/tests.rs +++ b/library/std/src/io/error/tests.rs @@ -157,7 +157,7 @@ impl error::Error for E {} fn test_std_io_error_downcast() { // Case 1: custom error, downcast succeeds let io_error = Error::new(ErrorKind::Other, Bojji(true)); - let e: Box<Bojji> = io_error.downcast().unwrap(); + let e: Bojji = io_error.downcast().unwrap(); assert!(e.0); // Case 2: custom error, downcast fails @@ -166,7 +166,7 @@ fn test_std_io_error_downcast() { // ensures that the custom error is intact assert_eq!(ErrorKind::Other, io_error.kind()); - let e: Box<Bojji> = io_error.downcast().unwrap(); + let e: Bojji = io_error.downcast().unwrap(); assert!(e.0); // Case 3: os error |
