@@ -14,7 +14,7 @@ use rustc_target::abi::LayoutOf;
1414use crate :: * ;
1515
1616/// Represent how path separator conversion should be done.
17- pub enum Pathconversion {
17+ pub enum PathConversion {
1818 HostToTarget ,
1919 TargetToHost ,
2020}
@@ -188,7 +188,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
188188 let this = self . eval_context_ref ( ) ;
189189 let os_str = this. read_os_str_from_c_str ( scalar) ?;
190190
191- Ok ( match this. convert_path_separator ( Cow :: Borrowed ( os_str) , Pathconversion :: TargetToHost ) {
191+ Ok ( match this. convert_path_separator ( Cow :: Borrowed ( os_str) , PathConversion :: TargetToHost ) {
192192 Cow :: Borrowed ( x) => Cow :: Borrowed ( Path :: new ( x) ) ,
193193 Cow :: Owned ( y) => Cow :: Owned ( PathBuf :: from ( y) ) ,
194194 } )
@@ -199,7 +199,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
199199 let this = self . eval_context_ref ( ) ;
200200 let os_str = this. read_os_str_from_wide_str ( scalar) ?;
201201
202- Ok ( this. convert_path_separator ( Cow :: Owned ( os_str) , Pathconversion :: TargetToHost ) . into_owned ( ) . into ( ) )
202+ Ok ( this. convert_path_separator ( Cow :: Owned ( os_str) , PathConversion :: TargetToHost ) . into_owned ( ) . into ( ) )
203203 }
204204
205205 /// Write a Path to the machine memory (as a null-terminated sequence of bytes),
@@ -211,7 +211,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
211211 size : u64 ,
212212 ) -> InterpResult < ' tcx , ( bool , u64 ) > {
213213 let this = self . eval_context_mut ( ) ;
214- let os_str = this. convert_path_separator ( Cow :: Borrowed ( path. as_os_str ( ) ) , Pathconversion :: HostToTarget ) ;
214+ let os_str = this. convert_path_separator ( Cow :: Borrowed ( path. as_os_str ( ) ) , PathConversion :: HostToTarget ) ;
215215 this. write_os_str_to_c_str ( & os_str, scalar, size)
216216 }
217217
@@ -224,14 +224,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
224224 size : u64 ,
225225 ) -> InterpResult < ' tcx , ( bool , u64 ) > {
226226 let this = self . eval_context_mut ( ) ;
227- let os_str = this. convert_path_separator ( Cow :: Borrowed ( path. as_os_str ( ) ) , Pathconversion :: HostToTarget ) ;
227+ let os_str = this. convert_path_separator ( Cow :: Borrowed ( path. as_os_str ( ) ) , PathConversion :: HostToTarget ) ;
228228 this. write_os_str_to_wide_str ( & os_str, scalar, size)
229229 }
230230
231231 fn convert_path_separator < ' a > (
232232 & self ,
233233 os_str : Cow < ' a , OsStr > ,
234- direction : Pathconversion ,
234+ direction : PathConversion ,
235235 ) -> Cow < ' a , OsStr > {
236236 let this = self . eval_context_ref ( ) ;
237237 let target_os = & this. tcx . sess . target . target . target_os ;
@@ -242,8 +242,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
242242 } else {
243243 // Unix target, Windows host.
244244 let ( from, to) = match direction {
245- Pathconversion :: HostToTarget => ( '\\' , '/' ) ,
246- Pathconversion :: TargetToHost => ( '/' , '\\' ) ,
245+ PathConversion :: HostToTarget => ( '\\' , '/' ) ,
246+ PathConversion :: TargetToHost => ( '/' , '\\' ) ,
247247 } ;
248248 let converted = os_str
249249 . encode_wide ( )
@@ -255,8 +255,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
255255 return if target_os == "windows" {
256256 // Windows target, Unix host.
257257 let ( from, to) = match direction {
258- Pathconversion :: HostToTarget => ( '/' , '\\' ) ,
259- Pathconversion :: TargetToHost => ( '\\' , '/' ) ,
258+ PathConversion :: HostToTarget => ( '/' , '\\' ) ,
259+ PathConversion :: TargetToHost => ( '\\' , '/' ) ,
260260 } ;
261261 let converted = os_str
262262 . as_bytes ( )
0 commit comments