Skip to content

Commit c1c82c2

Browse files
committed
Properly capitalize PathConversion
1 parent 4eea02e commit c1c82c2

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/shims/os_str.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_target::abi::LayoutOf;
1414
use 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()

src/shims/posix/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
13721372
let result = std::fs::read_link(pathname);
13731373
match result {
13741374
Ok(resolved) => {
1375-
let resolved = this.convert_path_separator(Cow::Borrowed(resolved.as_ref()), crate::shims::os_str::Pathconversion::HostToTarget);
1375+
let resolved = this.convert_path_separator(Cow::Borrowed(resolved.as_ref()), crate::shims::os_str::PathConversion::HostToTarget);
13761376
let mut path_bytes = crate::shims::os_str::os_str_to_bytes(resolved.as_ref())?;
13771377
let bufsize: usize = bufsize.try_into().unwrap();
13781378
if path_bytes.len() > bufsize {

0 commit comments

Comments
 (0)