File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88use crate :: {
99 bindings,
10- block:: mq:: { raw_writer :: RawWriter , Operations , TagSet } ,
10+ block:: mq:: { Operations , TagSet } ,
1111 error:: { self , from_err_ptr, Result } ,
1212 static_lock_class,
13+ str:: NullBorrowFormatter ,
1314 sync:: Arc ,
1415} ;
1516use core:: fmt:: { self , Write } ;
@@ -143,14 +144,13 @@ impl GenDiskBuilder {
143144 // SAFETY: `gendisk` is a valid pointer as we initialized it above
144145 unsafe { ( * gendisk) . fops = & TABLE } ;
145146
146- let mut raw_writer = RawWriter :: from_array (
147+ let mut writer = NullBorrowFormatter :: from_array (
147148 // SAFETY: `gendisk` points to a valid and initialized instance. We
148149 // have exclusive access, since the disk is not added to the VFS
149150 // yet.
150151 unsafe { & mut ( * gendisk) . disk_name } ,
151152 ) ?;
152- raw_writer. write_fmt ( name) ?;
153- raw_writer. write_char ( '\0' ) ?;
153+ writer. write_fmt ( name) ?;
154154
155155 // SAFETY: `gendisk` points to a valid and initialized instance of
156156 // `struct gendisk`. `set_capacity` takes a lock to synchronize this
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ impl<'a> RawWriter<'a> {
2424 Ok ( Self { buffer, pos : 0 } )
2525 }
2626
27+ #[ expect( dead_code) ]
2728 pub ( crate ) fn from_array < const N : usize > (
2829 a : & ' a mut [ crate :: ffi:: c_char ; N ] ,
2930 ) -> Result < RawWriter < ' a > > {
Original file line number Diff line number Diff line change @@ -881,7 +881,6 @@ impl<'a> NullBorrowFormatter<'a> {
881881 Ok ( Self { buffer, pos : 0 } )
882882 }
883883
884- #[ expect( dead_code) ]
885884 pub ( crate ) fn from_array < const N : usize > (
886885 a : & ' a mut [ crate :: ffi:: c_char ; N ] ,
887886 ) -> Result < NullBorrowFormatter < ' a > > {
@@ -891,12 +890,6 @@ impl<'a> NullBorrowFormatter<'a> {
891890 unsafe { core:: slice:: from_raw_parts_mut ( a. as_mut_ptr ( ) . cast :: < u8 > ( ) , N ) } ,
892891 )
893892 }
894-
895- /// Return the position of the write pointer in the underlying buffer.
896- #[ expect( dead_code) ]
897- pub ( crate ) fn pos ( & self ) -> usize {
898- self . pos
899- }
900893}
901894
902895impl Write for NullBorrowFormatter < ' _ > {
You can’t perform that action at this time.
0 commit comments