File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,8 @@ async fn main() -> Result<()> {
90
90
. await
91
91
. context ( "unexpectedly gave up" ) ?;
92
92
93
- for ip in result {
94
- println ! ( "{}" , ip )
93
+ for ( target , port ) in result {
94
+ println ! ( "{}:{} " , target , port )
95
95
}
96
96
97
97
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ impl Resolver {
137
137
pub async fn lookup_srv (
138
138
& self ,
139
139
srv : crate :: ServiceName ,
140
- ) -> Result < Vec < String > , ResolveError > {
140
+ ) -> Result < Vec < ( String , u16 ) > , ResolveError > {
141
141
let name = format ! ( "{}.{}" , srv. dns_name( ) , DNS_ZONE ) ;
142
142
trace ! ( self . log, "lookup_srv" ; "dns_name" => & name) ;
143
143
let response = self . inner . srv_lookup ( & name) . await ?;
@@ -148,7 +148,10 @@ impl Resolver {
148
148
"response" => ?response
149
149
) ;
150
150
151
- Ok ( response. into_iter ( ) . map ( |srv| srv. target ( ) . to_string ( ) ) . collect ( ) )
151
+ Ok ( response
152
+ . into_iter ( )
153
+ . map ( |srv| ( srv. target ( ) . to_string ( ) , srv. port ( ) ) )
154
+ . collect ( ) )
152
155
}
153
156
154
157
pub async fn lookup_all_ipv6 (
You can’t perform that action at this time.
0 commit comments