File tree Expand file tree Collapse file tree 8 files changed +16
-16
lines changed Expand file tree Collapse file tree 8 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -211,8 +211,8 @@ impl Config {
211211 }
212212 }
213213
214- pub fn get_str ( & self , key : & str ) -> Result < String > {
215- self . get ( key) . and_then ( Value :: into_str )
214+ pub fn get_string ( & self , key : & str ) -> Result < String > {
215+ self . get ( key) . and_then ( Value :: into_string )
216216 }
217217
218218 pub fn get_int ( & self , key : & str ) -> Result < i64 > {
Original file line number Diff line number Diff line change @@ -89,12 +89,12 @@ impl<'de> de::Deserializer<'de> for Value {
8989
9090 #[ inline]
9191 fn deserialize_str < V : de:: Visitor < ' de > > ( self , visitor : V ) -> Result < V :: Value > {
92- visitor. visit_string ( self . into_str ( ) ?)
92+ visitor. visit_string ( self . into_string ( ) ?)
9393 }
9494
9595 #[ inline]
9696 fn deserialize_string < V : de:: Visitor < ' de > > ( self , visitor : V ) -> Result < V :: Value > {
97- visitor. visit_string ( self . into_str ( ) ?)
97+ visitor. visit_string ( self . into_string ( ) ?)
9898 }
9999
100100 #[ inline]
@@ -421,12 +421,12 @@ impl<'de> de::Deserializer<'de> for Config {
421421
422422 #[ inline]
423423 fn deserialize_str < V : de:: Visitor < ' de > > ( self , visitor : V ) -> Result < V :: Value > {
424- visitor. visit_string ( self . cache . into_str ( ) ?)
424+ visitor. visit_string ( self . cache . into_string ( ) ?)
425425 }
426426
427427 #[ inline]
428428 fn deserialize_string < V : de:: Visitor < ' de > > ( self , visitor : V ) -> Result < V :: Value > {
429- visitor. visit_string ( self . cache . into_str ( ) ?)
429+ visitor. visit_string ( self . cache . into_string ( ) ?)
430430 }
431431
432432 #[ inline]
Original file line number Diff line number Diff line change @@ -286,9 +286,9 @@ impl Value {
286286 }
287287 }
288288
289- /// Returns `self` into a str , if possible.
289+ /// Returns `self` into a string , if possible.
290290 // FIXME: Should this not be `try_into_*` ?
291- pub fn into_str ( self ) -> Result < String > {
291+ pub fn into_string ( self ) -> Result < String > {
292292 match self . kind {
293293 ValueKind :: String ( value) => Ok ( value) ,
294294
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ fn test_file() {
6060 assert_eq ! ( s. elements. len( ) , 10 ) ;
6161 assert_eq ! ( s. elements[ 3 ] , "4" . to_string( ) ) ;
6262 assert_eq ! (
63- s. place. creator[ "name" ] . clone( ) . into_str ( ) . unwrap( ) ,
63+ s. place. creator[ "name" ] . clone( ) . into_string ( ) . unwrap( ) ,
6464 "John Smith" . to_string( )
6565 ) ;
6666}
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ fn test_file() {
6060 assert_eq ! ( s. elements. len( ) , 10 ) ;
6161 assert_eq ! ( s. elements[ 3 ] , "4" . to_string( ) ) ;
6262 assert_eq ! (
63- s. place. creator[ "name" ] . clone( ) . into_str ( ) . unwrap( ) ,
63+ s. place. creator[ "name" ] . clone( ) . into_string ( ) . unwrap( ) ,
6464 "John Smith" . to_string( )
6565 ) ;
6666}
@@ -98,7 +98,7 @@ fn test_json_vec() {
9898
9999 let v = c. get_array ( "WASTE" ) . unwrap ( ) ;
100100 let mut vi = v. into_iter ( ) ;
101- assert_eq ! ( vi. next( ) . unwrap( ) . into_str ( ) . unwrap( ) , "example_dir1" ) ;
102- assert_eq ! ( vi. next( ) . unwrap( ) . into_str ( ) . unwrap( ) , "example_dir2" ) ;
101+ assert_eq ! ( vi. next( ) . unwrap( ) . into_string ( ) . unwrap( ) , "example_dir1" ) ;
102+ assert_eq ! ( vi. next( ) . unwrap( ) . into_string ( ) . unwrap( ) , "example_dir2" ) ;
103103 assert ! ( vi. next( ) . is_none( ) ) ;
104104}
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ fn test_file() {
7171 assert_eq ! ( s. elements. len( ) , 10 ) ;
7272 assert_eq ! ( s. elements[ 3 ] , "4" . to_string( ) ) ;
7373 assert_eq ! (
74- s. place. creator[ "name" ] . clone( ) . into_str ( ) . unwrap( ) ,
74+ s. place. creator[ "name" ] . clone( ) . into_string ( ) . unwrap( ) ,
7575 "John Smith" . to_string( )
7676 ) ;
7777}
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ fn test_file() {
6060 assert_eq ! ( s. elements. len( ) , 10 ) ;
6161 assert_eq ! ( s. elements[ 3 ] , "4" . to_string( ) ) ;
6262 assert_eq ! (
63- s. place. creator[ "name" ] . clone( ) . into_str ( ) . unwrap( ) ,
63+ s. place. creator[ "name" ] . clone( ) . into_string ( ) . unwrap( ) ,
6464 "John Smith" . to_string( )
6565 ) ;
6666}
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ fn test_map() {
111111
112112 assert_eq ! ( m. len( ) , 8 ) ;
113113 assert_eq ! (
114- m[ "name" ] . clone( ) . into_str ( ) . unwrap( ) ,
114+ m[ "name" ] . clone( ) . into_string ( ) . unwrap( ) ,
115115 "Torre di Pisa" . to_string( )
116116 ) ;
117117 assert_eq ! ( m[ "reviews" ] . clone( ) . into_int( ) . unwrap( ) , 3866 ) ;
@@ -138,7 +138,7 @@ fn test_map_struct() {
138138
139139 assert_eq ! ( s. place. len( ) , 8 ) ;
140140 assert_eq ! (
141- s. place[ "name" ] . clone( ) . into_str ( ) . unwrap( ) ,
141+ s. place[ "name" ] . clone( ) . into_string ( ) . unwrap( ) ,
142142 "Torre di Pisa" . to_string( )
143143 ) ;
144144 assert_eq ! ( s. place[ "reviews" ] . clone( ) . into_int( ) . unwrap( ) , 3866 ) ;
You can’t perform that action at this time.
0 commit comments