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/).
80
80
Rustc and Xcode.
81
81
(#[ 1492] ( https://github.com/nix-rust/nix/pull/1492 ) )
82
82
83
+ - Deprecated ` SockAddr/InetAddr::to_str ` in favor of ` ToString::to_string `
84
+ (#[ 1495] ( https://github.com/nix-rust/nix/pull/1495 ) )
85
+
83
86
## [ 0.22.0] - 9 July 2021
84
87
### Added
85
88
- 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 {
344
344
}
345
345
}
346
346
347
+ #[ deprecated( since = "0.23.0" , note = "use .to_string() instead" ) ]
347
348
pub fn to_str ( & self ) -> String {
348
349
format ! ( "{}" , self )
349
350
}
@@ -722,6 +723,7 @@ impl SockAddr {
722
723
}
723
724
}
724
725
726
+ #[ deprecated( since = "0.23.0" , note = "use .to_string() instead" ) ]
725
727
pub fn to_str ( & self ) -> String {
726
728
format ! ( "{}" , self )
727
729
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ pub fn test_inetv4_addr_to_sock_addr() {
28
28
_ => panic ! ( "nope" ) ,
29
29
}
30
30
31
- assert_eq ! ( addr. to_str ( ) , "127.0.0.1:3000" ) ;
31
+ assert_eq ! ( addr. to_string ( ) , "127.0.0.1:3000" ) ;
32
32
33
33
let inet = addr. to_std ( ) ;
34
34
assert_eq ! ( actual, inet) ;
@@ -194,8 +194,8 @@ pub fn test_getsockname() {
194
194
. expect ( "socket failed" ) ;
195
195
let sockaddr = SockAddr :: new_unix ( & sockname) . unwrap ( ) ;
196
196
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 ( ) ) ;
199
199
}
200
200
201
201
#[ test]
You can’t perform that action at this time.
0 commit comments