Skip to content

Commit

Permalink
remove an unnecessary as_str
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Mar 25, 2020
1 parent 47b91e6 commit 962e210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ impl MemoryExtra {
pub fn init_extern_statics<'tcx, 'mir>(
this: &mut MiriEvalContext<'mir, 'tcx>,
) -> InterpResult<'tcx> {
let target_os = this.tcx.sess.target.target.target_os.as_str();
match target_os {
match this.tcx.sess.target.target.target_os.as_str() {
"linux" => {
// "__cxa_thread_atexit_impl"
// This should be all-zero, pointer-sized.
Expand Down
2 changes: 1 addition & 1 deletion src/shims/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx

this.check_no_isolation("mkdir")?;

let _mode = if this.tcx.sess.target.target.target_os.as_str() == "macos" {
let _mode = if this.tcx.sess.target.target.target_os == "macos" {
u32::from(this.read_scalar(mode_op)?.not_undef()?.to_u16()?)
} else {
this.read_scalar(mode_op)?.to_u32()?
Expand Down

0 comments on commit 962e210

Please # to comment.