1
1
use anyhow:: Result ;
2
- use fatfs:: { Date , DateTime , FileSystem , FormatVolumeOptions , FsOptions , StdIoWrapper , Time } ;
2
+ use fatfs:: { Date , DateTime , FileSystem , FormatVolumeOptions , FsOptions , Time } ;
3
3
use mbrman:: { MBRPartitionEntry , BOOT_INACTIVE , CHS , MBR } ;
4
4
use std:: io:: { Cursor , Read , Write } ;
5
5
use std:: ops:: Range ;
@@ -45,9 +45,9 @@ pub fn create_mbr_test_disk(path: &Path) -> Result<()> {
45
45
46
46
fn init_fat_test_partition ( disk : & mut [ u8 ] , partition_byte_range : Range < usize > ) -> Result < ( ) > {
47
47
{
48
- let mut cursor = StdIoWrapper :: from ( Cursor :: new ( & mut disk[ partition_byte_range. clone ( ) ] ) ) ;
48
+ let cursor = Cursor :: new ( & mut disk[ partition_byte_range. clone ( ) ] ) ;
49
49
fatfs:: format_volume (
50
- & mut cursor,
50
+ cursor,
51
51
FormatVolumeOptions :: new ( ) . volume_label ( * b"MbrTestDisk" ) ,
52
52
) ?;
53
53
}
@@ -72,10 +72,33 @@ fn init_fat_test_partition(disk: &mut [u8], partition_byte_range: Range<usize>)
72
72
// test.
73
73
#[ allow( deprecated) ]
74
74
{
75
- let time = Time :: new ( 0 , 0 , 0 , 0 ) ;
76
- file. set_created ( DateTime :: new ( Date :: new ( 2000 , 1 , 24 ) , time) ) ;
77
- file. set_accessed ( Date :: new ( 2001 , 2 , 25 ) ) ;
78
- file. set_modified ( DateTime :: new ( Date :: new ( 2002 , 3 , 26 ) , time) ) ;
75
+ let time = Time {
76
+ hour : 0 ,
77
+ min : 0 ,
78
+ sec : 0 ,
79
+ millis : 0 ,
80
+ } ;
81
+ file. set_created ( DateTime {
82
+ date : Date {
83
+ year : 2000 ,
84
+ month : 1 ,
85
+ day : 24 ,
86
+ } ,
87
+ time,
88
+ } ) ;
89
+ file. set_accessed ( Date {
90
+ year : 2001 ,
91
+ month : 2 ,
92
+ day : 25 ,
93
+ } ) ;
94
+ file. set_modified ( DateTime {
95
+ date : Date {
96
+ year : 2002 ,
97
+ month : 3 ,
98
+ day : 26 ,
99
+ } ,
100
+ time,
101
+ } ) ;
79
102
}
80
103
81
104
let stats = fs. stats ( ) ?;
0 commit comments