Adjust fuzzer and cargo to changes in core::str API

This commit is contained in:
Marijn Haverbeke 2012-02-23 17:11:21 +01:00
parent 780f8277f4
commit 0f00d9a797
3 changed files with 4 additions and 4 deletions

View File

@ -686,7 +686,7 @@ fn cmd_install(c: cargo) unsafe {
if str::starts_with(target, "uuid:") {
let uuid = rest(target, 5u);
alt str::index(uuid, '/') {
alt str::find_char(uuid, '/') {
option::some(idx) {
let source = str::slice(uuid, 0u, idx);
uuid = str::slice(uuid, idx + 1u, str::len(uuid));
@ -698,7 +698,7 @@ fn cmd_install(c: cargo) unsafe {
}
} else {
let name = target;
alt str::index(name, '/') {
alt str::find_char(name, '/') {
option::some(idx) {
let source = str::slice(name, 0u, idx);
name = str::slice(name, idx + 1u, str::len(name));

View File

@ -94,7 +94,7 @@ fn verify(root: str, data: str, sig: str, keyfp: str) -> bool {
let p = gpg(["--homedir", path, "--with-fingerprint", "--verify", sig,
data]);
let res = "Primary key fingerprint: " + keyfp;
for line in str::split_byte(p.err, '\n' as u8) {
for line in str::split_char(p.err, '\n') {
if line == res {
ret true;
}

View File

@ -286,7 +286,7 @@ fn check_variants_T<T: copy>(
}
fn last_part(filename: str) -> str {
let ix = option::get(str::rindex(filename, '/'));
let ix = option::get(str::rfind_char(filename, '/'));
str::slice(filename, ix + 1u, str::len(filename) - 3u)
}