@@ -102,38 +102,6 @@ lazy_static! {
102102 } ;
103103}
104104
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-
137105/// An enum representing the address of a MongoDB server.
138106///
139107/// Currently this just supports addresses that can be connected to over TCP, but alternative
@@ -200,16 +168,6 @@ impl Hash for ServerAddress {
200168 }
201169}
202170
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-
213171impl ServerAddress {
214172 /// Parses an address string into a `StreamAddress`.
215173 pub fn parse ( address : impl AsRef < str > ) -> Result < Self > {
0 commit comments