@@ -154,40 +154,40 @@ impl fmt::Display for E {
154154impl error:: Error for E { }
155155
156156#[ test]
157- fn test_try_downcast_inner ( ) {
157+ fn test_std_io_error_downcast ( ) {
158158 // Case 1: custom error, downcast succeeds
159159 let io_error = Error :: new ( ErrorKind :: Other , Bojji ( true ) ) ;
160- let e: Box < Bojji > = io_error. try_downcast_inner ( ) . unwrap ( ) ;
160+ let e: Box < Bojji > = io_error. downcast ( ) . unwrap ( ) ;
161161 assert ! ( e. 0 ) ;
162162
163163 // Case 2: custom error, downcast fails
164164 let io_error = Error :: new ( ErrorKind :: Other , Bojji ( true ) ) ;
165- let io_error = io_error. try_downcast_inner :: < E > ( ) . unwrap_err ( ) ;
165+ let io_error = io_error. downcast :: < E > ( ) . unwrap_err ( ) ;
166166
167167 // ensures that the custom error is intact
168168 assert_eq ! ( ErrorKind :: Other , io_error. kind( ) ) ;
169- let e: Box < Bojji > = io_error. try_downcast_inner ( ) . unwrap ( ) ;
169+ let e: Box < Bojji > = io_error. downcast ( ) . unwrap ( ) ;
170170 assert ! ( e. 0 ) ;
171171
172172 // Case 3: os error
173173 let errno = 20 ;
174174 let io_error = Error :: from_raw_os_error ( errno) ;
175- let io_error = io_error. try_downcast_inner :: < E > ( ) . unwrap_err ( ) ;
175+ let io_error = io_error. downcast :: < E > ( ) . unwrap_err ( ) ;
176176
177177 assert_eq ! ( errno, io_error. raw_os_error( ) . unwrap( ) ) ;
178178
179179 // Case 4: simple
180180 let kind = ErrorKind :: OutOfMemory ;
181181 let io_error: Error = kind. into ( ) ;
182- let io_error = io_error. try_downcast_inner :: < E > ( ) . unwrap_err ( ) ;
182+ let io_error = io_error. downcast :: < E > ( ) . unwrap_err ( ) ;
183183
184184 assert_eq ! ( kind, io_error. kind( ) ) ;
185185
186186 // Case 5: simple message
187187 const SIMPLE_MESSAGE : SimpleMessage =
188188 SimpleMessage { kind : ErrorKind :: Other , message : "simple message error test" } ;
189189 let io_error = Error :: from_static_message ( & SIMPLE_MESSAGE ) ;
190- let io_error = io_error. try_downcast_inner :: < E > ( ) . unwrap_err ( ) ;
190+ let io_error = io_error. downcast :: < E > ( ) . unwrap_err ( ) ;
191191
192192 assert_eq ! ( SIMPLE_MESSAGE . kind, io_error. kind( ) ) ;
193193 assert_eq ! ( SIMPLE_MESSAGE . message, & * format!( "{io_error}" ) ) ;
0 commit comments