From c6b4049a36f46174db9d8f9ef9f37cd3caf494e2 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Fri, 3 Oct 2025 11:32:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20`rust=5Fcargo=5Fn?= =?UTF-8?q?ote=5Fget=5Fsrc=5Fdefault`=EF=BC=8C=E5=A2=9E=E5=8A=A0=20`pl=5F`?= =?UTF-8?q?=20=E5=89=8D=E7=BC=80=E9=81=BF=E5=85=8D=E5=86=B2=E7=AA=81=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=E4=B8=80=E5=A4=84=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recipe/lang/Rust/Cargo.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/recipe/lang/Rust/Cargo.c b/src/recipe/lang/Rust/Cargo.c index 7545298..ddaf0ce 100644 --- a/src/recipe/lang/Rust/Cargo.c +++ b/src/recipe/lang/Rust/Cargo.c @@ -49,7 +49,7 @@ pl_rust_cargo_prelude (void) void -rust_cargo_note_get_src_default () +pl_rust_cargo_note_get_src_default () { if (ENGLISH) chsrc_note2 ("No source configured in Cargo, showing default upstream source:"); @@ -61,7 +61,7 @@ rust_cargo_note_get_src_default () } void -rust_cargo_note_get_src_mirror (char *url, bool sparse) +pl_rust_cargo_note_get_src_mirror (char *url, bool sparse) { if (ENGLISH) { @@ -94,7 +94,7 @@ pl_rust_cargo_getsrc (char *option) XyStrFindResult_t result_mirror = xy_str_find (formatted_content, xy_strcat (3, "[source.", mirror_name, "]")); if (!result_mirror.found) { - rust_cargo_note_get_src_default(); + pl_rust_cargo_note_get_src_default(); return; } char *mirror_url = xy_str_take_until_newline (formatted_content + result_mirror.end + 1); @@ -102,12 +102,12 @@ pl_rust_cargo_getsrc (char *option) mirror_url = xy_str_delete_suffix (mirror_url, "\""); if (xy_str_find (mirror_url, "sparse+").found) { - rust_cargo_note_get_src_mirror (xy_str_delete_prefix (mirror_url, "sparse+"), true); + pl_rust_cargo_note_get_src_mirror (xy_str_delete_prefix (mirror_url, "sparse+"), true); } } else { - rust_cargo_note_get_src_default(); + pl_rust_cargo_note_get_src_default(); } } @@ -146,8 +146,6 @@ pl_rust_cargo_setsrc (char *option) chsrc_backup (cargo_config_file); char *raw_content = xy_file_to_str (cargo_config_file); - char *formatted_content = xy_str_gsub (raw_content, " ", ""); - formatted_content = xy_str_gsub (raw_content, "\"", ""); XyStrFindResult_t result_has_mirror = xy_str_find (raw_content, "replace-with"); if (!result_has_mirror.found)