File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ This project adheres to [Semantic Versioning](https://semver.org/).
8080 Rustc and Xcode.
8181 (#[ 1492] ( https://github.com/nix-rust/nix/pull/1492 ) )
8282
83+ - Deprecated ` SockAddr/InetAddr::to_str ` in favor of ` ToString::to_string `
84+ (#[ 1495] ( https://github.com/nix-rust/nix/pull/1495 ) )
85+
8386## [ 0.22.0] - 9 July 2021
8487### Added
8588- Added ` if_nameindex ` (#[ 1445] ( https://github.com/nix-rust/nix/pull/1445 ) )
Original file line number Diff line number Diff line change @@ -344,6 +344,7 @@ impl InetAddr {
344344 }
345345 }
346346
347+ #[ deprecated( since = "0.23.0" , note = "use .to_string() instead" ) ]
347348 pub fn to_str ( & self ) -> String {
348349 format ! ( "{}" , self )
349350 }
@@ -722,6 +723,7 @@ impl SockAddr {
722723 }
723724 }
724725
726+ #[ deprecated( since = "0.23.0" , note = "use .to_string() instead" ) ]
725727 pub fn to_str ( & self ) -> String {
726728 format ! ( "{}" , self )
727729 }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ pub fn test_inetv4_addr_to_sock_addr() {
2828 _ => panic ! ( "nope" ) ,
2929 }
3030
31- assert_eq ! ( addr. to_str ( ) , "127.0.0.1:3000" ) ;
31+ assert_eq ! ( addr. to_string ( ) , "127.0.0.1:3000" ) ;
3232
3333 let inet = addr. to_std ( ) ;
3434 assert_eq ! ( actual, inet) ;
@@ -194,8 +194,8 @@ pub fn test_getsockname() {
194194 . expect ( "socket failed" ) ;
195195 let sockaddr = SockAddr :: new_unix ( & sockname) . unwrap ( ) ;
196196 bind ( sock, & sockaddr) . expect ( "bind failed" ) ;
197- assert_eq ! ( sockaddr. to_str ( ) ,
198- getsockname( sock) . expect( "getsockname failed" ) . to_str ( ) ) ;
197+ assert_eq ! ( sockaddr. to_string ( ) ,
198+ getsockname( sock) . expect( "getsockname failed" ) . to_string ( ) ) ;
199199}
200200
201201#[ test]
You can’t perform that action at this time.
0 commit comments