提交 0f00d9a7 编写于 作者: M Marijn Haverbeke

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

上级 780f8277
...@@ -686,7 +686,7 @@ fn cmd_install(c: cargo) unsafe { ...@@ -686,7 +686,7 @@ fn cmd_install(c: cargo) unsafe {
if str::starts_with(target, "uuid:") { if str::starts_with(target, "uuid:") {
let uuid = rest(target, 5u); let uuid = rest(target, 5u);
alt str::index(uuid, '/') { alt str::find_char(uuid, '/') {
option::some(idx) { option::some(idx) {
let source = str::slice(uuid, 0u, idx); let source = str::slice(uuid, 0u, idx);
uuid = str::slice(uuid, idx + 1u, str::len(uuid)); uuid = str::slice(uuid, idx + 1u, str::len(uuid));
...@@ -698,7 +698,7 @@ fn cmd_install(c: cargo) unsafe { ...@@ -698,7 +698,7 @@ fn cmd_install(c: cargo) unsafe {
} }
} else { } else {
let name = target; let name = target;
alt str::index(name, '/') { alt str::find_char(name, '/') {
option::some(idx) { option::some(idx) {
let source = str::slice(name, 0u, idx); let source = str::slice(name, 0u, idx);
name = str::slice(name, idx + 1u, str::len(name)); name = str::slice(name, idx + 1u, str::len(name));
......
...@@ -94,7 +94,7 @@ fn verify(root: str, data: str, sig: str, keyfp: str) -> bool { ...@@ -94,7 +94,7 @@ fn verify(root: str, data: str, sig: str, keyfp: str) -> bool {
let p = gpg(["--homedir", path, "--with-fingerprint", "--verify", sig, let p = gpg(["--homedir", path, "--with-fingerprint", "--verify", sig,
data]); data]);
let res = "Primary key fingerprint: " + keyfp; 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 { if line == res {
ret true; ret true;
} }
......
...@@ -286,7 +286,7 @@ fn check_variants_T<T: copy>( ...@@ -286,7 +286,7 @@ fn check_variants_T<T: copy>(
} }
fn last_part(filename: str) -> str { 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) str::slice(filename, ix + 1u, str::len(filename) - 3u)
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册