@@ -5,7 +5,6 @@ use libc::{c_char, c_int, c_void, size_t};
55use std:: ffi:: { c_uint, CStr , CString } ;
66use std:: mem;
77
8- #[ allow( unused) ]
98/// Stash application options structure
109pub struct StashSaveOptions < ' a > {
1110 message : Option < CString > ,
@@ -72,13 +71,14 @@ impl<'a> StashSaveOptions<'a> {
7271///
7372/// Return `true` to continue processing, or `false` to
7473/// abort the stash application.
74+ // FIXME: This probably should have been pub(crate) since it is not used anywhere.
7575pub type StashApplyProgressCb < ' a > = dyn FnMut ( StashApplyProgress ) -> bool + ' a ;
7676
7777/// This is a callback function you can provide to iterate over all the
7878/// stashed states that will be invoked per entry.
79+ // FIXME: This probably should have been pub(crate) since it is not used anywhere.
7980pub type StashCb < ' a > = dyn FnMut ( usize , & str , & Oid ) -> bool + ' a ;
8081
81- #[ allow( unused) ]
8282/// Stash application options structure
8383pub struct StashApplyOptions < ' cb > {
8484 progress : Option < Box < StashApplyProgressCb < ' cb > > > ,
@@ -144,22 +144,20 @@ impl<'cb> StashApplyOptions<'cb> {
144144 }
145145}
146146
147- #[ allow( unused) ]
148- pub struct StashCbData < ' a > {
147+ pub ( crate ) struct StashCbData < ' a > {
149148 pub callback : & ' a mut StashCb < ' a > ,
150149}
151150
152- #[ allow( unused) ]
153- pub extern "C" fn stash_cb (
151+ pub ( crate ) extern "C" fn stash_cb (
154152 index : size_t ,
155153 message : * const c_char ,
156154 stash_id : * const raw:: git_oid ,
157155 payload : * mut c_void ,
158156) -> c_int {
159157 panic:: wrap ( || unsafe {
160- let mut data = & mut * ( payload as * mut StashCbData < ' _ > ) ;
158+ let data = & mut * ( payload as * mut StashCbData < ' _ > ) ;
161159 let res = {
162- let mut callback = & mut data. callback ;
160+ let callback = & mut data. callback ;
163161 callback (
164162 index,
165163 CStr :: from_ptr ( message) . to_str ( ) . unwrap ( ) ,
@@ -191,15 +189,14 @@ fn convert_progress(progress: raw::git_stash_apply_progress_t) -> StashApplyProg
191189 }
192190}
193191
194- #[ allow( unused) ]
195192extern "C" fn stash_apply_progress_cb (
196193 progress : raw:: git_stash_apply_progress_t ,
197194 payload : * mut c_void ,
198195) -> c_int {
199196 panic:: wrap ( || unsafe {
200- let mut options = & mut * ( payload as * mut StashApplyOptions < ' _ > ) ;
197+ let options = & mut * ( payload as * mut StashApplyOptions < ' _ > ) ;
201198 let res = {
202- let mut callback = options. progress . as_mut ( ) . unwrap ( ) ;
199+ let callback = options. progress . as_mut ( ) . unwrap ( ) ;
203200 callback ( convert_progress ( progress) )
204201 } ;
205202
0 commit comments