Skip to content

Commit eaa4bef

Browse files
committed
Replacing str::unsafe_from_bytes with str::from_bytes (part 3)
1 parent 64ce563 commit eaa4bef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ fn sanitize(s: str) -> str {
274274
c != ' ' as u8 && c != '\t' as u8 && c != ';' as u8
275275
{
276276
let v = [c];
277-
result += str::unsafe_from_bytes(v);
277+
result += str::from_bytes(v);
278278
}
279279
}
280280
}

src/comp/util/ppaux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn ty_to_str(cx: ctxt, typ: t) -> str {
122122
}
123123
ty_var(v) { "<T" + int::str(v) + ">" }
124124
ty_param(id, _) {
125-
"'" + str::unsafe_from_bytes([('a' as u8) + (id as u8)])
125+
"'" + str::from_bytes([('a' as u8) + (id as u8)])
126126
}
127127
_ { ty_to_short_str(cx, typ) }
128128
}

0 commit comments

Comments
 (0)