@@ -23,7 +23,7 @@ pub(super) async fn sync(
2323 trace ! ( "storage is empty; attempting to apply a snapshot" ) ;
2424 if let Some ( ( version, snap) ) = server. get_snapshot ( ) . await ? {
2525 snapshot:: apply_snapshot ( txn, version, snap. as_ref ( ) ) . await ?;
26- trace ! ( "applied snapshot for version {}" , version ) ;
26+ trace ! ( "applied snapshot for version {version}" ) ;
2727 }
2828 }
2929
@@ -74,7 +74,7 @@ pub(super) async fn sync(
7474 let version: Version = serde_json:: from_str ( version_str) . unwrap ( ) ;
7575
7676 // apply this version and update base_version in storage
77- info ! ( "applying version {:?} from server" , version_id ) ;
77+ info ! ( "applying version {version_id :?} from server" ) ;
7878 apply_version (
7979 txn,
8080 & mut sync_ops_batch,
@@ -85,7 +85,7 @@ pub(super) async fn sync(
8585 txn. set_base_version ( version_id) . await ?;
8686 base_version_id = version_id;
8787 } else {
88- info ! ( "no child versions of {:?}" , base_version_id ) ;
88+ info ! ( "no child versions of {base_version_id :?}" ) ;
8989 // at the moment, no more child versions, so we can try adding our own
9090 break ;
9191 }
@@ -109,7 +109,7 @@ pub(super) async fn sync(
109109 server. add_version ( base_version_id, history_segment) . await ?;
110110 match res {
111111 AddVersionResult :: Ok ( new_version_id) => {
112- info ! ( "version {:?} received by server" , new_version_id ) ;
112+ info ! ( "version {new_version_id :?} received by server" ) ;
113113 txn. set_base_version ( new_version_id) . await ?;
114114 base_version_id = new_version_id;
115115
@@ -125,10 +125,7 @@ pub(super) async fn sync(
125125 }
126126 }
127127 AddVersionResult :: ExpectedParentVersion ( parent_version_id) => {
128- info ! (
129- "new version rejected; must be based on {:?}" ,
130- parent_version_id
131- ) ;
128+ info ! ( "new version rejected; must be based on {parent_version_id:?}" ) ;
132129 if let Some ( requested) = requested_parent_version_id {
133130 if parent_version_id == requested {
134131 return Err ( Error :: OutOfSync ) ;
@@ -185,31 +182,25 @@ async fn apply_version(
185182 // indicating no operation is required. If this happens for a local op, we can just omit
186183 // it. If it happens for server op, then we must copy the remaining local ops.
187184 for server_op in version. operations . drain ( ..) {
188- trace ! (
189- "rebasing local operations onto server operation {:?}" ,
190- server_op
191- ) ;
185+ trace ! ( "rebasing local operations onto server operation {server_op:?}" ) ;
192186 let mut new_local_ops = Vec :: with_capacity ( local_ops. len ( ) ) ;
193187 let mut svr_op = Some ( server_op) ;
194188 for local_op in local_ops. drain ( ..) {
195189 if let Some ( o) = svr_op {
196190 let ( new_server_op, new_local_op) = SyncOp :: transform ( o, local_op. clone ( ) ) ;
197- trace ! ( "local operation {:?} -> {:?}" , local_op , new_local_op ) ;
191+ trace ! ( "local operation {local_op :?} -> {new_local_op :?}" ) ;
198192 svr_op = new_server_op;
199193 if let Some ( o) = new_local_op {
200194 new_local_ops. push ( o) ;
201195 }
202196 } else {
203- trace ! (
204- "local operation {:?} unchanged (server operation consumed)" ,
205- local_op
206- ) ;
197+ trace ! ( "local operation {local_op:?} unchanged (server operation consumed)" ) ;
207198 new_local_ops. push ( local_op) ;
208199 }
209200 }
210201 if let Some ( o) = svr_op {
211202 if let Err ( e) = apply:: apply_op ( txn, & o) . await {
212- warn ! ( "Invalid operation when syncing: {} (ignored)" , e ) ;
203+ warn ! ( "Invalid operation when syncing: {e } (ignored)" ) ;
213204 }
214205 transformed_server_ops. push ( o) ;
215206 }
0 commit comments