@@ -5,7 +5,6 @@ use libc::{c_char, c_int, c_void, size_t};
5
5
use std:: ffi:: { c_uint, CStr , CString } ;
6
6
use std:: mem;
7
7
8
- #[ allow( unused) ]
9
8
/// Stash application options structure
10
9
pub struct StashSaveOptions < ' a > {
11
10
message : Option < CString > ,
@@ -72,13 +71,14 @@ impl<'a> StashSaveOptions<'a> {
72
71
///
73
72
/// Return `true` to continue processing, or `false` to
74
73
/// abort the stash application.
74
+ // FIXME: This probably should have been pub(crate) since it is not used anywhere.
75
75
pub type StashApplyProgressCb < ' a > = dyn FnMut ( StashApplyProgress ) -> bool + ' a ;
76
76
77
77
/// This is a callback function you can provide to iterate over all the
78
78
/// stashed states that will be invoked per entry.
79
+ // FIXME: This probably should have been pub(crate) since it is not used anywhere.
79
80
pub type StashCb < ' a > = dyn FnMut ( usize , & str , & Oid ) -> bool + ' a ;
80
81
81
- #[ allow( unused) ]
82
82
/// Stash application options structure
83
83
pub struct StashApplyOptions < ' cb > {
84
84
progress : Option < Box < StashApplyProgressCb < ' cb > > > ,
@@ -144,22 +144,20 @@ impl<'cb> StashApplyOptions<'cb> {
144
144
}
145
145
}
146
146
147
- #[ allow( unused) ]
148
- pub struct StashCbData < ' a > {
147
+ pub ( crate ) struct StashCbData < ' a > {
149
148
pub callback : & ' a mut StashCb < ' a > ,
150
149
}
151
150
152
- #[ allow( unused) ]
153
- pub extern "C" fn stash_cb (
151
+ pub ( crate ) extern "C" fn stash_cb (
154
152
index : size_t ,
155
153
message : * const c_char ,
156
154
stash_id : * const raw:: git_oid ,
157
155
payload : * mut c_void ,
158
156
) -> c_int {
159
157
panic:: wrap ( || unsafe {
160
- let mut data = & mut * ( payload as * mut StashCbData < ' _ > ) ;
158
+ let data = & mut * ( payload as * mut StashCbData < ' _ > ) ;
161
159
let res = {
162
- let mut callback = & mut data. callback ;
160
+ let callback = & mut data. callback ;
163
161
callback (
164
162
index,
165
163
CStr :: from_ptr ( message) . to_str ( ) . unwrap ( ) ,
@@ -191,15 +189,14 @@ fn convert_progress(progress: raw::git_stash_apply_progress_t) -> StashApplyProg
191
189
}
192
190
}
193
191
194
- #[ allow( unused) ]
195
192
extern "C" fn stash_apply_progress_cb (
196
193
progress : raw:: git_stash_apply_progress_t ,
197
194
payload : * mut c_void ,
198
195
) -> c_int {
199
196
panic:: wrap ( || unsafe {
200
- let mut options = & mut * ( payload as * mut StashApplyOptions < ' _ > ) ;
197
+ let options = & mut * ( payload as * mut StashApplyOptions < ' _ > ) ;
201
198
let res = {
202
- let mut callback = options. progress . as_mut ( ) . unwrap ( ) ;
199
+ let callback = options. progress . as_mut ( ) . unwrap ( ) ;
203
200
callback ( convert_progress ( progress) )
204
201
} ;
205
202
0 commit comments