File tree 2 files changed +3
-10
lines changed
2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ nom = { version = "^5.0", optional = true }
23
23
bufstream = { version = " ^0.1" , optional = true }
24
24
rustls = { version = " ^0.16" , optional = true }
25
25
base64 = { version = " ^0.11" , optional = true }
26
- hostname = { version = " ^0.2 " , optional = true }
26
+ hostname = { version = " 0.1.5 " , optional = true }
27
27
serde = { version = " ^1.0" , optional = true }
28
28
serde_json = { version = " ^1.0" , optional = true }
29
29
serde_derive = { version = " ^1.0" , optional = true }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use crate::smtp::authentication::Mechanism;
4
4
use crate :: smtp:: error:: Error ;
5
5
use crate :: smtp:: response:: Response ;
6
6
use crate :: smtp:: util:: XText ;
7
- use hostname:: get as get_hostname;
7
+ use hostname:: get_hostname;
8
8
use std:: collections:: HashSet ;
9
9
use std:: fmt:: { self , Display , Formatter } ;
10
10
use std:: net:: { Ipv4Addr , Ipv6Addr } ;
@@ -47,14 +47,7 @@ impl ClientId {
47
47
/// Defines a `ClientId` with the current hostname, of `localhost` if hostname could not be
48
48
/// found
49
49
pub fn hostname ( ) -> ClientId {
50
- ClientId :: Domain (
51
- get_hostname ( )
52
- . map ( |s| {
53
- s. into_string ( )
54
- . unwrap_or_else ( |_| DEFAULT_DOMAIN_CLIENT_ID . to_string ( ) )
55
- } )
56
- . unwrap_or_else ( |_| DEFAULT_DOMAIN_CLIENT_ID . to_string ( ) ) ,
57
- )
50
+ ClientId :: Domain ( get_hostname ( ) . unwrap_or_else ( || DEFAULT_DOMAIN_CLIENT_ID . to_string ( ) ) )
58
51
}
59
52
}
60
53
You can’t perform that action at this time.
0 commit comments