@@ -102,38 +102,6 @@ lazy_static! {
102
102
} ;
103
103
}
104
104
105
- /// A hostname:port address pair.
106
- #[ derive( Clone , Debug , Eq ) ]
107
- #[ deprecated = "This type has been renamed to `ServerAddress` and will be removed in the 2.0.0 \
108
- stable release"]
109
- pub struct StreamAddress {
110
- /// The hostname of the address.
111
- pub hostname : String ,
112
-
113
- /// The port of the address.
114
- ///
115
- /// The default is 27017.
116
- pub port : Option < u16 > ,
117
- }
118
-
119
- #[ allow( deprecated) ]
120
- impl PartialEq for StreamAddress {
121
- fn eq ( & self , other : & Self ) -> bool {
122
- self . hostname == other. hostname && self . port . unwrap_or ( 27017 ) == other. port . unwrap_or ( 27017 )
123
- }
124
- }
125
-
126
- #[ allow( deprecated) ]
127
- impl Hash for StreamAddress {
128
- fn hash < H > ( & self , state : & mut H )
129
- where
130
- H : Hasher ,
131
- {
132
- self . hostname . hash ( state) ;
133
- self . port . unwrap_or ( 27017 ) . hash ( state) ;
134
- }
135
- }
136
-
137
105
/// An enum representing the address of a MongoDB server.
138
106
///
139
107
/// Currently this just supports addresses that can be connected to over TCP, but alternative
@@ -200,16 +168,6 @@ impl Hash for ServerAddress {
200
168
}
201
169
}
202
170
203
- #[ allow( deprecated) ]
204
- impl From < StreamAddress > for ServerAddress {
205
- fn from ( sa : StreamAddress ) -> Self {
206
- Self :: Tcp {
207
- host : sa. hostname ,
208
- port : sa. port ,
209
- }
210
- }
211
- }
212
-
213
171
impl ServerAddress {
214
172
/// Parses an address string into a `StreamAddress`.
215
173
pub fn parse ( address : impl AsRef < str > ) -> Result < Self > {
0 commit comments