@@ -20,7 +20,7 @@ use sqlx::any::AnyConnectOptions;
2020use std:: convert:: { TryFrom , TryInto } ;
2121use std:: env:: var;
2222use std:: fmt:: { Debug , Display , Formatter } ;
23- use std:: net:: { IpAddr , Ipv4Addr , SocketAddr } ;
23+ use std:: net:: { IpAddr , Ipv6Addr , SocketAddr } ;
2424use std:: path:: { Path , PathBuf } ;
2525use std:: str:: FromStr ;
2626
@@ -183,9 +183,7 @@ impl TryFrom<PartialConfig> for Config {
183183 let bind = match config. socket {
184184 Some ( socket) => Bind :: Unix ( socket, socket_permissions) ,
185185 None => {
186- let ip = config
187- . bind
188- . unwrap_or_else ( || IpAddr :: V4 ( Ipv4Addr :: new ( 0 , 0 , 0 , 0 ) ) ) ;
186+ let ip = config. bind . unwrap_or ( IpAddr :: V6 ( Ipv6Addr :: UNSPECIFIED ) ) ;
189187 let port = config. port . unwrap_or ( 7867 ) ;
190188 Bind :: Tcp ( ( ip, port) . into ( ) )
191189 }
@@ -194,9 +192,7 @@ impl TryFrom<PartialConfig> for Config {
194192 let metrics_bind = match ( config. metrics_socket , config. metrics_port ) {
195193 ( Some ( socket) , _) => Some ( Bind :: Unix ( socket, socket_permissions) ) ,
196194 ( None , Some ( port) ) => {
197- let ip = config
198- . bind
199- . unwrap_or_else ( || IpAddr :: V4 ( Ipv4Addr :: new ( 0 , 0 , 0 , 0 ) ) ) ;
195+ let ip = config. bind . unwrap_or ( IpAddr :: V6 ( Ipv6Addr :: UNSPECIFIED ) ) ;
200196 Some ( Bind :: Tcp ( ( ip, port) . into ( ) ) )
201197 }
202198 _ => None ,
0 commit comments