File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -50,17 +50,25 @@ impl Client {
50
50
51
51
#[ cfg( unix) ]
52
52
/// Initialize a new [`Client`] from raw file descriptor.
53
+ #[ deprecated( since="0.8.0" , note="please use `new_from_fd` instead" ) ]
53
54
pub fn new ( fd : RawFd ) -> Client {
54
55
let conn = ClientConnection :: new ( fd) ;
55
56
56
- // TODO: upgrade the API of Client::new and remove this panic for the major version release
57
57
Self :: new_client ( conn) . unwrap_or_else ( |e| {
58
58
panic ! (
59
59
"client was not successfully initialized: {}" , e
60
60
)
61
61
} )
62
62
}
63
63
64
+ #[ cfg( unix) ]
65
+ /// Initialize a new [`Client`] from raw file descriptor.
66
+ pub fn new_from_fd ( fd : RawFd ) -> Result < Client > {
67
+ let conn = ClientConnection :: new ( fd) ;
68
+
69
+ Self :: new_client ( conn)
70
+ }
71
+
64
72
fn new_client ( pipe_client : ClientConnection ) -> Result < Client > {
65
73
let client = Arc :: new ( pipe_client) ;
66
74
You can’t perform that action at this time.
0 commit comments