File tree Expand file tree Collapse file tree 4 files changed +8
-14
lines changed
Expand file tree Collapse file tree 4 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ http = "1.1.0"
1414http-body = " 1.0.1"
1515hyper = { version = " 1.6.0" , features = [" client" , " http2" ] }
1616hyper-util = " 0.1.14"
17- once_cell = " 1.19.0"
1817parking_lot = " 0.12.4"
1918pin-project-lite = " 0.2.16"
2019rand = " 0.9"
@@ -43,5 +42,4 @@ allowed_external_types = [
4342 " tonic::*" ,
4443 " futures_core::stream::Stream" ,
4544 " tokio::sync::oneshot::Sender" ,
46- " once_cell::sync::Lazy" ,
4745]
Original file line number Diff line number Diff line change 11use std:: {
22 collections:: HashMap ,
3- sync:: { Arc , Mutex } ,
3+ sync:: { Arc , LazyLock , Mutex } ,
44} ;
55
6- use once_cell:: sync:: Lazy ;
7-
86use super :: LbPolicyBuilder ;
97
108/// A registry to store and retrieve LB policies. LB policies are indexed by
@@ -39,4 +37,4 @@ impl Default for LbPolicyRegistry {
3937
4038/// The registry used if a local registry is not provided to a channel or if it
4139/// does not exist in the local registry.
42- pub static GLOBAL_LB_REGISTRY : Lazy < LbPolicyRegistry > = Lazy :: new ( LbPolicyRegistry :: new) ;
40+ pub static GLOBAL_LB_REGISTRY : LazyLock < LbPolicyRegistry > = LazyLock :: new ( LbPolicyRegistry :: new) ;
Original file line number Diff line number Diff line change 11use std:: {
22 collections:: HashMap ,
3- sync:: { Arc , Mutex } ,
3+ sync:: { Arc , LazyLock , Mutex } ,
44} ;
55
6- use once_cell:: sync:: Lazy ;
7-
86use super :: Transport ;
97
108/// A registry to store and retrieve transports. Transports are indexed by
@@ -59,4 +57,5 @@ impl Default for TransportRegistry {
5957
6058/// The registry used if a local registry is not provided to a channel or if it
6159/// does not exist in the local registry.
62- pub static GLOBAL_TRANSPORT_REGISTRY : Lazy < TransportRegistry > = Lazy :: new ( TransportRegistry :: new) ;
60+ pub static GLOBAL_TRANSPORT_REGISTRY : LazyLock < TransportRegistry > =
61+ LazyLock :: new ( TransportRegistry :: new) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use std::{
33 ops:: Add ,
44 sync:: {
55 atomic:: { AtomicU32 , Ordering } ,
6- Arc ,
6+ Arc , LazyLock ,
77 } ,
88} ;
99
@@ -18,7 +18,6 @@ use crate::{
1818 server,
1919 service:: { Request , Response , Service } ,
2020} ;
21- use once_cell:: sync:: Lazy ;
2221use tokio:: sync:: { mpsc, oneshot, Mutex , Notify } ;
2322use tonic:: async_trait;
2423
@@ -93,8 +92,8 @@ impl crate::server::Listener for Arc<Listener> {
9392 }
9493}
9594
96- static LISTENERS : Lazy < std:: sync:: Mutex < HashMap < String , Arc < Listener > > > > =
97- Lazy :: new ( std:: sync:: Mutex :: default) ;
95+ static LISTENERS : LazyLock < std:: sync:: Mutex < HashMap < String , Arc < Listener > > > > =
96+ LazyLock :: new ( std:: sync:: Mutex :: default) ;
9897
9998struct ClientTransport { }
10099
You can’t perform that action at this time.
0 commit comments