@@ -14,7 +14,7 @@ fn test_as_py_obj_bool() {
1414 Python :: attach ( |py| {
1515 let b = Value :: Bool ( true ) . as_py_obj ( py) . unwrap ( ) ;
1616 assert ! ( b. is_instance_of:: <pyo3:: types:: PyBool >( ) ) ;
17- assert ! ( b. downcast_exact :: <pyo3:: types:: PyBool >( ) . unwrap( ) . is_true( ) ) ;
17+ assert ! ( b. cast_exact :: <pyo3:: types:: PyBool >( ) . unwrap( ) . is_true( ) ) ;
1818 } ) ;
1919}
2020
@@ -27,7 +27,7 @@ fn test_as_py_obj_int() {
2727 let pyn = n. as_py_obj ( py) . unwrap ( ) ;
2828 let n = n. as_i64 ( ) . unwrap ( ) ;
2929 assert ! ( pyn. is_instance_of:: <pyo3:: types:: PyInt >( ) ) ;
30- assert ! ( pyn. downcast_exact :: <pyo3:: types:: PyInt >( ) . unwrap( ) . eq( & n) ) ;
30+ assert ! ( pyn. cast_exact :: <pyo3:: types:: PyInt >( ) . unwrap( ) . eq( & n) ) ;
3131 }
3232 } ) ;
3333}
@@ -39,10 +39,7 @@ fn test_as_py_obj_float() {
3939 let n: Value = 3.14 . into ( ) ;
4040 let n = n. as_py_obj ( py) . unwrap ( ) ;
4141 assert ! ( n. is_instance_of:: <pyo3:: types:: PyFloat >( ) ) ;
42- assert ! ( n
43- . downcast_exact:: <pyo3:: types:: PyFloat >( )
44- . unwrap( )
45- . eq( & 3.14 ) ) ;
42+ assert ! ( n. cast_exact:: <pyo3:: types:: PyFloat >( ) . unwrap( ) . eq( & 3.14 ) ) ;
4643 } ) ;
4744}
4845
@@ -54,7 +51,7 @@ fn test_as_py_obj_sequence() {
5451 let s = s. as_py_obj ( py) . unwrap ( ) ;
5552 assert ! ( s. is_instance_of:: <pyo3:: types:: PyList >( ) ) ;
5653 assert ! ( s
57- . downcast_exact :: <pyo3:: types:: PyList >( )
54+ . cast_exact :: <pyo3:: types:: PyList >( )
5855 . unwrap( )
5956 . eq( & vec![ 1 , 2 , 3 ] )
6057 . unwrap( ) ) ;
@@ -70,7 +67,7 @@ fn test_as_py_obj_string() {
7067 . unwrap ( ) ;
7168 assert ! ( s. is_instance_of:: <pyo3:: types:: PyString >( ) ) ;
7269 assert_eq ! (
73- s. downcast_exact :: <pyo3:: types:: PyString >( )
70+ s. cast_exact :: <pyo3:: types:: PyString >( )
7471 . unwrap( )
7572 . to_str( )
7673 . unwrap( ) ,
0 commit comments