@@ -12,7 +12,7 @@ use crate::{
12
12
fl_slice:: { fl_slice_empty, flslice_as_str, AsFlSlice , FlSliceOwner } ,
13
13
Database , Result ,
14
14
} ;
15
- use log:: { error, info} ;
15
+ use log:: { debug , error, info} ;
16
16
use std:: {
17
17
convert:: TryFrom , mem, os:: raw:: c_void, panic:: catch_unwind, process:: abort, ptr, ptr:: NonNull ,
18
18
} ;
@@ -23,13 +23,6 @@ struct CallContext {
23
23
after_pull_ctx : * mut c_void ,
24
24
}
25
25
26
- impl Drop for CallContext {
27
- fn drop ( & mut self ) {
28
- println ! ( "CallContext.drop()" ) ;
29
- // fields are dropped implicitely (I think)
30
- }
31
- }
32
-
33
26
pub ( crate ) struct Replicator {
34
27
inner : NonNull < C4Replicator > ,
35
28
c_callback_on_status_changed : C4ReplicatorStatusChangedCallback ,
@@ -45,7 +38,6 @@ unsafe impl Send for Replicator {}
45
38
46
39
impl Drop for Replicator {
47
40
fn drop ( & mut self ) {
48
- println ! ( "Replicator.drop()" ) ;
49
41
unsafe {
50
42
c4repl_free ( self . inner . as_ptr ( ) ) ;
51
43
( self . free_callback_f ) ( self . callback_context . as_ptr ( ) ) ;
@@ -108,7 +100,7 @@ impl Replicator {
108
100
G : FnMut ( & str , & str , C4RevisionFlags , & str ) -> String + Send ,
109
101
{
110
102
let call_result = catch_unwind ( || {
111
- println ! ( "call_before_push" ) ;
103
+ debug ! ( "call_before_push" ) ;
112
104
let call_context = ctx as * mut CallContext ;
113
105
let call_context = match call_context. as_ref ( ) {
114
106
None => panic ! ( "Internal error - null callback context" ) ,
@@ -127,13 +119,14 @@ impl Replicator {
127
119
( * boxed_before_push_hook) ( rust_id, rust_rev, flags, body_string) ;
128
120
call_result
129
121
} ) ;
122
+ #[ allow( clippy:: match_wild_err_arm) ]
130
123
match call_result {
131
- Err ( _ ) => {
124
+ Err ( _error ) => {
132
125
error ! ( "Replicator::call_before_push catch panic aborting" ) ;
133
126
panic ! ( ) ;
134
127
}
135
128
Ok ( result) => {
136
- println ! ( "before_push hook returned {:?}" , result) ;
129
+ debug ! ( "before_push hook returned {:?}" , result) ;
137
130
let copy = FLSlice_Copy ( result. as_str ( ) . as_flslice ( ) ) ;
138
131
copy. as_flslice ( )
139
132
}
@@ -168,13 +161,14 @@ impl Replicator {
168
161
( * boxed_after_pull_hook) ( rust_id, rust_rev, flags, body_string) ;
169
162
call_result
170
163
} ) ;
164
+ #[ allow( clippy:: match_wild_err_arm) ]
171
165
match call_result {
172
- Err ( _ ) => {
166
+ Err ( _error ) => {
173
167
error ! ( "Replicator::call_after_pull catch panic aborting" ) ;
174
168
panic ! ( ) ;
175
169
}
176
170
Ok ( result) => {
177
- println ! ( "after_pull hook returned {:?}" , result) ;
171
+ debug ! ( "after_pull hook returned {:?}" , result) ;
178
172
let copy = FLSlice_Copy ( result. as_str ( ) . as_flslice ( ) ) ;
179
173
copy. as_flslice ( )
180
174
}
@@ -187,7 +181,7 @@ impl Replicator {
187
181
let boxed_state_change: * mut F = Box :: into_raw ( Box :: new ( state_changed_callback) ) ;
188
182
let boxed_before_push: * mut G =
189
183
before_push. map_or_else ( ptr:: null_mut, |f| Box :: into_raw ( Box :: new ( f) ) ) ;
190
- println ! ( "boxed_before_push={:?}" , boxed_before_push) ;
184
+ debug ! ( "boxed_before_push={:?}" , boxed_before_push) ;
191
185
let boxed_after_pull: * mut H =
192
186
after_pull. map_or_else ( ptr:: null_mut, |f| Box :: into_raw ( Box :: new ( f) ) ) ;
193
187
let callback_context = CallContext {
0 commit comments