@@ -93,9 +93,7 @@ fn try_raw_entries<const N: usize>(
9393 entries : & [ Option < & IndexEntry > ; N ] ,
9494 cb : impl FnOnce ( & [ * const raw:: git_index_entry ; N ] ) -> Result < ( ) , Error > ,
9595) -> Result < ( ) , Error > {
96- let mut paths: [ Option < CString > ; N ] = unsafe {
97- std:: mem:: MaybeUninit :: uninit ( ) . assume_init ( )
98- } ;
96+ let mut paths: [ Option < CString > ; N ] = unsafe { std:: mem:: MaybeUninit :: uninit ( ) . assume_init ( ) } ;
9997 for ( path, entry) in paths. iter_mut ( ) . zip ( entries. iter ( ) ) {
10098 let c_path = if let Some ( entry) = entry {
10199 Some ( CString :: new ( & entry. path [ ..] ) ?)
@@ -104,12 +102,13 @@ fn try_raw_entries<const N: usize>(
104102 } ;
105103
106104 let path_ptr: * mut Option < CString > = path;
107- unsafe { path_ptr. write ( c_path) ; }
105+ unsafe {
106+ path_ptr. write ( c_path) ;
107+ }
108108 }
109109
110- let mut raw_entries: [ Option < raw:: git_index_entry > ; N ] = unsafe {
111- std:: mem:: MaybeUninit :: uninit ( ) . assume_init ( )
112- } ;
110+ let mut raw_entries: [ Option < raw:: git_index_entry > ; N ] =
111+ unsafe { std:: mem:: MaybeUninit :: uninit ( ) . assume_init ( ) } ;
113112 for ( raw_entry, ( entry, path) ) in raw_entries. iter_mut ( ) . zip ( entries. iter ( ) . zip ( & paths) ) {
114113 let c_raw_entry = if let Some ( entry) = entry {
115114 // libgit2 encodes the length of the path in the lower bits of the
@@ -148,17 +147,20 @@ fn try_raw_entries<const N: usize>(
148147 } ;
149148
150149 let raw_entry_ptr: * mut Option < raw:: git_index_entry > = raw_entry;
151- unsafe { raw_entry_ptr. write ( c_raw_entry) ; }
150+ unsafe {
151+ raw_entry_ptr. write ( c_raw_entry) ;
152+ }
152153 }
153154
154- let mut raw_entry_ptrs: [ * const raw:: git_index_entry ; N ] = unsafe {
155- std:: mem:: MaybeUninit :: uninit ( ) . assume_init ( )
156- } ;
155+ let mut raw_entry_ptrs: [ * const raw:: git_index_entry ; N ] =
156+ unsafe { std:: mem:: MaybeUninit :: uninit ( ) . assume_init ( ) } ;
157157 for ( raw_entry_ptr, raw_entry) in raw_entry_ptrs. iter_mut ( ) . zip ( raw_entries. iter ( ) ) {
158158 let c_raw_entry_ptr = raw_entry. as_ref ( ) . map_or_else ( std:: ptr:: null, |ptr| ptr) ;
159159
160160 let raw_entry_ptr_ptr: * mut * const raw:: git_index_entry = raw_entry_ptr;
161- unsafe { raw_entry_ptr_ptr. write ( c_raw_entry_ptr) ; }
161+ unsafe {
162+ raw_entry_ptr_ptr. write ( c_raw_entry_ptr) ;
163+ }
162164 }
163165
164166 cb ( & raw_entry_ptrs)
0 commit comments