Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
String 如何在其他功能中使用Ruplacer(Rust)_String_Replace_Rust - Fatal编程技术网

String 如何在其他功能中使用Ruplacer(Rust)

String 如何在其他功能中使用Ruplacer(Rust),string,replace,rust,String,Replace,Rust,我试图编写一个函数来替换目录中的字符串。我还建立了一个用Rust编写的性能库,但文档仅在CLI中工作。现在我无法将库自定义为这样的函数: fn替换(路径、foo、bar){ ruplacer(路径、foo、bar) } 它没有真正的文档化,因为它不打算真正用作库,但下面是ruplacer板条箱的API:

我试图编写一个函数来替换目录中的字符串。我还建立了一个用Rust编写的性能库,但文档仅在CLI中工作。现在我无法将库自定义为这样的函数:

fn替换(路径、foo、bar){
ruplacer(路径、foo、bar)
}

它没有真正的文档化,因为它不打算真正用作库,但下面是ruplacer板条箱的API: