Skip to content

Commit e1d04e0

Browse files
killerswanmarijnh
authored andcommitted
(core::str) add a safe byte slice and maybe_slice ++
1 parent 7c78b7d commit e1d04e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ fn substr(s: str, begin: uint, len: uint) -> str {
401401
// beyond the last character of the string
402402
fn slice(ss: str, begin: uint, end: uint) -> str {
403403
alt maybe_slice(ss, begin, end) {
404-
none { fail "slice requires a valid start and end"; }
405404
some(sli) { ret sli; }
405+
none { fail "slice requires a valid start and end"; }
406406
}
407407
}
408408

0 commit comments

Comments
 (0)