@@ -82,12 +82,12 @@ macro_rules! shardable_key {
82
82
83
83
fn shards(
84
84
& self ,
85
- pd_client: & std:: sync:: Arc <impl crate :: pd:: PdClient >,
85
+ pd_client: & std:: sync:: Arc <impl $ crate:: pd:: PdClient >,
86
86
) -> futures:: stream:: BoxStream <
87
87
' static ,
88
- crate :: Result <( Self :: Shard , crate :: store:: RegionStore ) >,
88
+ $ crate:: Result <( Self :: Shard , $ crate:: store:: RegionStore ) >,
89
89
> {
90
- crate :: store:: store_stream_for_keys(
90
+ $ crate:: store:: store_stream_for_keys(
91
91
std:: iter:: once( self . key. clone( ) ) ,
92
92
pd_client. clone( ) ,
93
93
)
@@ -96,8 +96,8 @@ macro_rules! shardable_key {
96
96
fn apply_shard(
97
97
& mut self ,
98
98
mut shard: Self :: Shard ,
99
- store: & crate :: store:: RegionStore ,
100
- ) -> crate :: Result <( ) > {
99
+ store: & $ crate:: store:: RegionStore ,
100
+ ) -> $ crate:: Result <( ) > {
101
101
self . set_context( store. region_with_leader. context( ) ?) ;
102
102
assert!( shard. len( ) == 1 ) ;
103
103
self . set_key( shard. pop( ) . unwrap( ) ) ;
@@ -115,21 +115,21 @@ macro_rules! shardable_keys {
115
115
116
116
fn shards(
117
117
& self ,
118
- pd_client: & std:: sync:: Arc <impl crate :: pd:: PdClient >,
118
+ pd_client: & std:: sync:: Arc <impl $ crate:: pd:: PdClient >,
119
119
) -> futures:: stream:: BoxStream <
120
120
' static ,
121
- crate :: Result <( Self :: Shard , crate :: store:: RegionStore ) >,
121
+ $ crate:: Result <( Self :: Shard , $ crate:: store:: RegionStore ) >,
122
122
> {
123
123
let mut keys = self . keys. clone( ) ;
124
124
keys. sort( ) ;
125
- crate :: store:: store_stream_for_keys( keys. into_iter( ) , pd_client. clone( ) )
125
+ $ crate:: store:: store_stream_for_keys( keys. into_iter( ) , pd_client. clone( ) )
126
126
}
127
127
128
128
fn apply_shard(
129
129
& mut self ,
130
130
shard: Self :: Shard ,
131
- store: & crate :: store:: RegionStore ,
132
- ) -> crate :: Result <( ) > {
131
+ store: & $ crate:: store:: RegionStore ,
132
+ ) -> $ crate:: Result <( ) > {
133
133
self . set_context( store. region_with_leader. context( ) ?) ;
134
134
self . set_keys( shard. into_iter( ) . map( Into :: into) . collect( ) ) ;
135
135
Ok ( ( ) )
@@ -146,18 +146,18 @@ macro_rules! shardable_range {
146
146
147
147
fn shards(
148
148
& self ,
149
- pd_client: & Arc <impl crate :: pd:: PdClient >,
150
- ) -> BoxStream <' static , crate :: Result <( Self :: Shard , crate :: store:: RegionStore ) >> {
149
+ pd_client: & Arc <impl $ crate:: pd:: PdClient >,
150
+ ) -> BoxStream <' static , $ crate:: Result <( Self :: Shard , $ crate:: store:: RegionStore ) >> {
151
151
let start_key = self . start_key. clone( ) . into( ) ;
152
152
let end_key = self . end_key. clone( ) . into( ) ;
153
- crate :: store:: store_stream_for_range( ( start_key, end_key) , pd_client. clone( ) )
153
+ $ crate:: store:: store_stream_for_range( ( start_key, end_key) , pd_client. clone( ) )
154
154
}
155
155
156
156
fn apply_shard(
157
157
& mut self ,
158
158
shard: Self :: Shard ,
159
- store: & crate :: store:: RegionStore ,
160
- ) -> crate :: Result <( ) > {
159
+ store: & $ crate:: store:: RegionStore ,
160
+ ) -> $ crate:: Result <( ) > {
161
161
self . set_context( store. region_with_leader. context( ) ?) ;
162
162
163
163
self . set_start_key( shard. 0 . into( ) ) ;
0 commit comments