Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SandmeyerX/rustlings-zh-cn
/ functions
Functions
673 in github.com/SandmeyerX/rustlings-zh-cn
⨍
Functions
673
◇
Types & classes
100
↓ 10 callers
Function
placeholder
对这个函数的调用应该替换为对函数 `string_slice` 或者 `string` 的调用。
exercises/09_strings/strings4.rs:2
↓ 8 callers
Method
details
(&self)
solutions/19_smart_pointers/rc1.rs:23
↓ 8 callers
Method
details
(&self)
exercises/19_smart_pointers/rc1.rs:23
↓ 7 callers
Function
string
(arg: String)
solutions/09_strings/strings4.rs:5
↓ 5 callers
Function
get_map
()
solutions/18_iterators/iterators5.rs:74
↓ 5 callers
Function
get_map
()
exercises/18_iterators/iterators5.rs:58
↓ 5 callers
Method
parse
(s: &str)
solutions/13_error_handling/errors6.rs:56
↓ 5 callers
Method
process
(&mut self, message: Message)
solutions/08_enums/enums3.rs:47
↓ 5 callers
Method
process
(&mut self, message: Message)
exercises/08_enums/enums3.rs:46
↓ 4 callers
Function
abs_all
(input: &mut Cow<[i32]>)
solutions/19_smart_pointers/cow1.rs:7
↓ 4 callers
Function
abs_all
(input: &mut Cow<[i32]>)
exercises/19_smart_pointers/cow1.rs:7
↓ 4 callers
Function
fruit_basket
(basket: &mut HashMap<Fruit, u32>)
solutions/11_hashmaps/hashmaps2.rs:20
↓ 4 callers
Function
fruit_basket
(basket: &mut HashMap<Fruit, u32>)
exercises/11_hashmaps/hashmaps2.rs:20
↓ 4 callers
Function
get_fruit_basket
不要修改这个函数!
solutions/11_hashmaps/hashmaps2.rs:44
↓ 4 callers
Function
get_fruit_basket
不要修改这个函数!
exercises/11_hashmaps/hashmaps2.rs:44
↓ 4 callers
Function
get_vec_map
()
solutions/18_iterators/iterators5.rs:86
↓ 4 callers
Function
get_vec_map
()
exercises/18_iterators/iterators5.rs:72
↓ 4 callers
Function
string_slice
(arg: &str)
solutions/09_strings/strings4.rs:1
↓ 3 callers
Method
append_bar
(self)
solutions/15_traits/traits1.rs:7
↓ 3 callers
Function
build_scores_table
(results: &str)
solutions/11_hashmaps/hashmaps3.rs:16
↓ 3 callers
Function
build_scores_table
(results: &str)
exercises/11_hashmaps/hashmaps3.rs:16
↓ 3 callers
Method
parse
(s: &str)
exercises/13_error_handling/errors6.rs:41
↓ 2 callers
Function
call_me
(num: u8)
exercises/02_functions/functions3.rs:1
↓ 2 callers
Function
capitalize_first
完成 `capitalize_first` 函数。 "hello" -> "Hello"
solutions/18_iterators/iterators2.rs:5
↓ 2 callers
Function
divide
(a: i64, b: i64)
solutions/18_iterators/iterators3.rs:11
↓ 2 callers
Function
divide
TODO: 如果 `a` 能被 `b` 整除,那么计算 `a` 除以 `b` 的结果。 否则,返回一个合适的错误。
exercises/18_iterators/iterators3.rs:13
↓ 2 callers
Function
fruit_basket
()
solutions/11_hashmaps/hashmaps1.rs:8
↓ 2 callers
Function
fruit_basket
()
exercises/11_hashmaps/hashmaps1.rs:8
↓ 2 callers
Method
licensing_info
(&self)
solutions/15_traits/traits4.rs:2
↓ 2 callers
Method
licensing_info
(&self)
exercises/15_traits/traits4.rs:2
↓ 2 callers
Function
longest
(x: &'a str, y: &'a str)
solutions/16_lifetimes/lifetimes2.rs:1
↓ 2 callers
Function
transformer
使用循环的解决方案。查看 `transformer_iter` 可得到一个使用迭代器的版本。
solutions/quizzes/quiz2.rs:23
↓ 1 callers
Method
append_bar
(mut self)
solutions/15_traits/traits2.rs:6
↓ 1 callers
Function
array_and_vec
()
solutions/05_vecs/vecs1.rs:1
↓ 1 callers
Function
array_and_vec
()
exercises/05_vecs/vecs1.rs:1
↓ 1 callers
Method
call
(&self)
solutions/08_enums/enums2.rs:19
↓ 1 callers
Method
call
(&self)
exercises/08_enums/enums2.rs:13
↓ 1 callers
Function
call_me
(num: u8)
solutions/02_functions/functions3.rs:1
↓ 1 callers
Function
call_me
一个名为`call_me`的函数,该函数没有参数且没有返回值。
solutions/02_functions/functions1.rs:2
↓ 1 callers
Function
call_me
函数参数的类型必须进行标注。 添加类型注解 `u64`。
solutions/02_functions/functions2.rs:3
↓ 1 callers
Function
call_me
TODO: 在 `:` 后添加参数 `num` 缺失的类型。
exercises/02_functions/functions2.rs:2
↓ 1 callers
Method
change_color
(&mut self, red: u8, green: u8, blue: u8)
solutions/08_enums/enums3.rs:39
↓ 1 callers
Function
count_for
(map: &HashMap<String, Progress>, value: Progress)
solutions/18_iterators/iterators5.rs:15
↓ 1 callers
Function
count_iterator
(map: &HashMap<String, Progress>, value: Progress)
solutions/18_iterators/iterators5.rs:25
↓ 1 callers
Function
create_order_template
()
solutions/07_structs/structs2.rs:12
↓ 1 callers
Function
create_order_template
()
exercises/07_structs/structs2.rs:12
↓ 1 callers
Function
current_favorite_color
()
solutions/09_strings/strings1.rs:1
↓ 1 callers
Function
current_favorite_color
TODO: 在不改变函数签名的前提下,修复编译器错误。
exercises/09_strings/strings1.rs:2
↓ 1 callers
Method
echo
(&mut self, s: String)
solutions/08_enums/enums3.rs:35
↓ 1 callers
Function
fill_vec
(mut vec: Vec<i32>)
solutions/06_move_semantics/move_semantics3.rs:1
↓ 1 callers
Function
fill_vec
(vec: Vec<i32>)
solutions/06_move_semantics/move_semantics1.rs:1
↓ 1 callers
Function
fill_vec
(vec: Vec<i32>)
solutions/06_move_semantics/move_semantics2.rs:1
↓ 1 callers
Function
fill_vec
TODO: 在不添加任何新的一行的情况下修复函数中的编译器错误。
exercises/06_move_semantics/move_semantics3.rs:2
↓ 1 callers
Function
fill_vec
TODO: 修改这个函数中的编译器错误。
exercises/06_move_semantics/move_semantics1.rs:2
↓ 1 callers
Function
fill_vec
(vec: Vec<i32>)
exercises/06_move_semantics/move_semantics2.rs:1
↓ 1 callers
Function
get_char
借用(Borrows)而不是获取所有权(ownership)。 在这里,建议使用 `&str` 而不是 `&String`。但目前这样就ok,因为我们还没有处理字符串相关的内容。
solutions/06_move_semantics/move_semantics5.rs:5
↓ 1 callers
Function
get_char
不应该取得所有权
exercises/06_move_semantics/move_semantics5.rs:7
↓ 1 callers
Function
get_secret_recipe
()
solutions/10_modules/modules1.rs:2
↓ 1 callers
Function
get_secret_recipe
不要让此模块之外的任何人看到我们的秘方(`get_secert_recipe`)!
exercises/10_modules/modules1.rs:4
↓ 1 callers
Function
is_a_color_word
(attempt: &str)
solutions/09_strings/strings2.rs:1
↓ 1 callers
Function
is_a_color_word
TODO: 在不修改此函数的情况下,修复 `main` 函数中的编译器错误。
exercises/09_strings/strings2.rs:2
↓ 1 callers
Function
is_even
(num: i64)
solutions/02_functions/functions4.rs:1
↓ 1 callers
Function
is_even
(num: i64)
exercises/02_functions/functions4.rs:6
↓ 1 callers
Function
longest
不要修改此函数。
exercises/16_lifetimes/lifetimes2.rs:2
↓ 1 callers
Function
make_sausage
在 `fn` 前添加 `pub` 使其在模块外部可被访问。
solutions/10_modules/modules1.rs:7
↓ 1 callers
Function
make_sausage
()
exercises/10_modules/modules1.rs:8
↓ 1 callers
Function
maybe_ice_cream
此函数返回冰箱中剩余的冰淇淋数量。 在22:00(24小时制)之前,冰淇淋还剩下5勺。 在22:00时,有人会把冰淇淋全部吃完,所以就没有剩余(值为0)。 如果 `hour_of_day` 大于23,则返回 `None`。
solutions/12_options/options1.rs:5
↓ 1 callers
Function
maybe_icecream
此函数返回冰箱中剩余的冰淇淋数量。 在22:00(24小时制)之前,冰淇淋还剩下5勺。 在22:00时,有人会把冰淇淋全部吃完,所以就没有剩余(值为0)。 如果 `hour_of_day` 大于23,则返回 `None`。
exercises/12_options/options1.rs:5
↓ 1 callers
Method
move_position
(&mut self, point: Point)
solutions/08_enums/enums3.rs:31
↓ 1 callers
Function
num_sq
使用 `as_mut()` 并对一个数字进行求平方操作。
solutions/23_conversions/as_ref_mut.rs:18
↓ 1 callers
Function
num_sq
使用 `as_mut()` 并对一个数字进行求平方操作。 TODO: 添加特征约束。
exercises/23_conversions/as_ref_mut.rs:21
↓ 1 callers
Method
other_function
(&self)
solutions/15_traits/traits5.rs:8
↓ 1 callers
Method
other_function
(&self)
exercises/15_traits/traits5.rs:8
↓ 1 callers
Method
quit
(&mut self)
solutions/08_enums/enums3.rs:43
↓ 1 callers
Method
resize
(&mut self, width: u64, height: u64)
solutions/08_enums/enums3.rs:26
↓ 1 callers
Method
resize
(&mut self, width: u64, height: u64)
exercises/08_enums/enums3.rs:25
↓ 1 callers
Function
send_tx
(q: Queue, tx: mpsc::Sender<u32>)
solutions/20_threads/threads3.rs:17
↓ 1 callers
Function
send_tx
(q: Queue, tx: mpsc::Sender<u32>)
exercises/20_threads/threads3.rs:17
↓ 1 callers
Method
some_function
(&self)
solutions/15_traits/traits5.rs:2
↓ 1 callers
Method
some_function
(&self)
exercises/15_traits/traits5.rs:2
↓ 1 callers
Function
square
(num: i32)
solutions/02_functions/functions5.rs:1
↓ 1 callers
Function
square
TODO: 修改函数体,但不要修改函数签名。
exercises/02_functions/functions5.rs:2
↓ 1 callers
Function
string_uppercase
获取所有权,而不是借用。
solutions/06_move_semantics/move_semantics5.rs:10
↓ 1 callers
Function
string_uppercase
应该取得所有权
exercises/06_move_semantics/move_semantics5.rs:12
↓ 1 callers
Function
total_cost
不要修改此函数。
solutions/13_error_handling/errors3.rs:7
↓ 1 callers
Function
total_cost
不要修改此函数。
exercises/13_error_handling/errors3.rs:7
↓ 1 callers
Function
vec_loop
(input: &[i32])
solutions/05_vecs/vecs2.rs:1
↓ 1 callers
Function
vec_loop
(input: &[i32])
exercises/05_vecs/vecs2.rs:1
↓ 1 callers
Function
vec_map
(input: &[i32])
solutions/05_vecs/vecs2.rs:27
↓ 1 callers
Function
vec_map
(input: &[i32])
exercises/05_vecs/vecs2.rs:28
↓ 1 callers
Function
vec_map_example
(input: &[i32])
solutions/05_vecs/vecs2.rs:11
↓ 1 callers
Function
vec_map_example
(input: &[i32])
exercises/05_vecs/vecs2.rs:12
Function
all_fruit_types_in_basket
()
solutions/11_hashmaps/hashmaps2.rs:75
Function
all_fruit_types_in_basket
()
exercises/11_hashmaps/hashmaps2.rs:75
Function
animal_habitat
(animal: &str)
solutions/03_if/if3.rs:1
Function
animal_habitat
(animal: &str)
exercises/03_if/if3.rs:1
Function
at_least_five_fruits
()
solutions/11_hashmaps/hashmaps1.rs:37
Function
at_least_five_fruits
()
exercises/11_hashmaps/hashmaps1.rs:35
Function
at_least_five_types_of_fruits
()
solutions/11_hashmaps/hashmaps2.rs:59
Function
at_least_five_types_of_fruits
()
exercises/11_hashmaps/hashmaps2.rs:59
next →
1–100 of 673, ranked by callers