File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
datadog-ffe/src/rules_based Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -87,17 +87,17 @@ mod pyo3_impl {
8787
8888 #[ inline]
8989 fn extract ( value : Borrowed < ' a , ' py , PyAny > ) -> PyResult < Self > {
90- if let Ok ( s) = value. downcast :: < PyString > ( ) {
90+ if let Ok ( s) = value. cast :: < PyString > ( ) {
9191 return Ok ( Attribute ( AttributeImpl :: String ( s. to_cow ( ) ?. into ( ) ) ) ) ;
9292 }
9393 // In Python, Bool inherits from Int, so it must be checked first here.
94- if let Ok ( s) = value. downcast :: < PyBool > ( ) {
94+ if let Ok ( s) = value. cast :: < PyBool > ( ) {
9595 return Ok ( Attribute ( AttributeImpl :: Boolean ( s. is_true ( ) ) ) ) ;
9696 }
97- if let Ok ( s) = value. downcast :: < PyFloat > ( ) {
97+ if let Ok ( s) = value. cast :: < PyFloat > ( ) {
9898 return Ok ( Attribute ( AttributeImpl :: Number ( s. value ( ) ) ) ) ;
9999 }
100- if let Ok ( s) = value. downcast :: < PyInt > ( ) {
100+ if let Ok ( s) = value. cast :: < PyInt > ( ) {
101101 return Ok ( Attribute ( AttributeImpl :: Number ( s. extract :: < f64 > ( ) ?) ) ) ;
102102 }
103103 if value. is_none ( ) {
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ mod pyo3_impl {
7777 fn extract ( value : Borrowed < ' a , ' py , PyAny > ) -> PyResult < Self > {
7878 let py = value. py ( ) ;
7979
80- let ( targeting_key, attributes) = if let Ok ( dict) = value. downcast :: < PyDict > ( ) {
80+ let ( targeting_key, attributes) = if let Ok ( dict) = value. cast :: < PyDict > ( ) {
8181 (
8282 dict. get_item ( intern ! ( py, "targeting_key" ) ) ?,
8383 dict. get_item ( intern ! ( py, "attributes" ) ) ?,
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ mod pyo3_impl {
125125
126126 #[ inline]
127127 fn extract ( value : Borrowed < ' a , ' py , PyAny > ) -> PyResult < Self > {
128- let s = value. downcast :: < PyString > ( ) ?;
128+ let s = value. cast :: < PyString > ( ) ?;
129129 Ok ( Str :: from ( s. to_cow ( ) ?) )
130130 }
131131 }
You can’t perform that action at this time.
0 commit comments