File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,7 @@ impl fmt::Display for Error {
49
49
pub type Result < T > = result:: Result < T , Error > ;
50
50
51
51
fn valid_char ( c : char ) -> bool {
52
- match c {
53
- ' ' ..='~' => true ,
54
- _ => false ,
55
- }
52
+ matches ! ( c, ' ' ..='~' )
56
53
}
57
54
58
55
fn valid_str ( s : & str ) -> Result < ( ) > {
@@ -164,7 +161,7 @@ impl Cmdline {
164
161
165
162
/// Returns the cmdline in progress as CString.
166
163
pub fn as_cstring ( & self ) -> Result < CString > {
167
- Ok ( CString :: new ( self . line . clone ( ) ) . map_err ( |_| Error :: InvalidAscii ) ? )
164
+ CString :: new ( self . line . clone ( ) ) . map_err ( |_| Error :: InvalidAscii )
168
165
}
169
166
}
170
167
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ impl fmt::Display for Error {
41
41
Error :: InvalidProgramHeaderSize => "Invalid ELF program header size" ,
42
42
Error :: InvalidProgramHeaderOffset => "Invalid ELF program header offset" ,
43
43
Error :: InvalidProgramHeaderAddress => "Invalid ELF program header address" ,
44
- Error :: ReadKernelDataStruct ( ref e) => e,
44
+ Error :: ReadKernelDataStruct ( e) => e,
45
45
Error :: ReadKernelImage => "Failed to write kernel image to guest memory" ,
46
46
Error :: SeekKernelStart => {
47
47
"Failed to seek to file offset as pointed by the ELF program header"
You can’t perform that action at this time.
0 commit comments