MCPcopy Create free account

hub / github.com/SandmeyerX/rustlings-zh-cn / functions

Functions673 in github.com/SandmeyerX/rustlings-zh-cn

↓ 10 callersFunctionplaceholder
对这个函数的调用应该替换为对函数 `string_slice` 或者 `string` 的调用。
exercises/09_strings/strings4.rs:2
↓ 8 callersMethoddetails
(&self)
solutions/19_smart_pointers/rc1.rs:23
↓ 8 callersMethoddetails
(&self)
exercises/19_smart_pointers/rc1.rs:23
↓ 7 callersFunctionstring
(arg: String)
solutions/09_strings/strings4.rs:5
↓ 5 callersFunctionget_map
()
solutions/18_iterators/iterators5.rs:74
↓ 5 callersFunctionget_map
()
exercises/18_iterators/iterators5.rs:58
↓ 5 callersMethodparse
(s: &str)
solutions/13_error_handling/errors6.rs:56
↓ 5 callersMethodprocess
(&mut self, message: Message)
solutions/08_enums/enums3.rs:47
↓ 5 callersMethodprocess
(&mut self, message: Message)
exercises/08_enums/enums3.rs:46
↓ 4 callersFunctionabs_all
(input: &mut Cow<[i32]>)
solutions/19_smart_pointers/cow1.rs:7
↓ 4 callersFunctionabs_all
(input: &mut Cow<[i32]>)
exercises/19_smart_pointers/cow1.rs:7
↓ 4 callersFunctionfruit_basket
(basket: &mut HashMap<Fruit, u32>)
solutions/11_hashmaps/hashmaps2.rs:20
↓ 4 callersFunctionfruit_basket
(basket: &mut HashMap<Fruit, u32>)
exercises/11_hashmaps/hashmaps2.rs:20
↓ 4 callersFunctionget_fruit_basket
不要修改这个函数!
solutions/11_hashmaps/hashmaps2.rs:44
↓ 4 callersFunctionget_fruit_basket
不要修改这个函数!
exercises/11_hashmaps/hashmaps2.rs:44
↓ 4 callersFunctionget_vec_map
()
solutions/18_iterators/iterators5.rs:86
↓ 4 callersFunctionget_vec_map
()
exercises/18_iterators/iterators5.rs:72
↓ 4 callersFunctionstring_slice
(arg: &str)
solutions/09_strings/strings4.rs:1
↓ 3 callersMethodappend_bar
(self)
solutions/15_traits/traits1.rs:7
↓ 3 callersFunctionbuild_scores_table
(results: &str)
solutions/11_hashmaps/hashmaps3.rs:16
↓ 3 callersFunctionbuild_scores_table
(results: &str)
exercises/11_hashmaps/hashmaps3.rs:16
↓ 3 callersMethodparse
(s: &str)
exercises/13_error_handling/errors6.rs:41
↓ 2 callersFunctioncall_me
(num: u8)
exercises/02_functions/functions3.rs:1
↓ 2 callersFunctioncapitalize_first
完成 `capitalize_first` 函数。 "hello" -> "Hello"
solutions/18_iterators/iterators2.rs:5
↓ 2 callersFunctiondivide
(a: i64, b: i64)
solutions/18_iterators/iterators3.rs:11
↓ 2 callersFunctiondivide
TODO: 如果 `a` 能被 `b` 整除,那么计算 `a` 除以 `b` 的结果。 否则,返回一个合适的错误。
exercises/18_iterators/iterators3.rs:13
↓ 2 callersFunctionfruit_basket
()
solutions/11_hashmaps/hashmaps1.rs:8
↓ 2 callersFunctionfruit_basket
()
exercises/11_hashmaps/hashmaps1.rs:8
↓ 2 callersMethodlicensing_info
(&self)
solutions/15_traits/traits4.rs:2
↓ 2 callersMethodlicensing_info
(&self)
exercises/15_traits/traits4.rs:2
↓ 2 callersFunctionlongest
(x: &'a str, y: &'a str)
solutions/16_lifetimes/lifetimes2.rs:1
↓ 2 callersFunctiontransformer
使用循环的解决方案。查看 `transformer_iter` 可得到一个使用迭代器的版本。
solutions/quizzes/quiz2.rs:23
↓ 1 callersMethodappend_bar
(mut self)
solutions/15_traits/traits2.rs:6
↓ 1 callersFunctionarray_and_vec
()
solutions/05_vecs/vecs1.rs:1
↓ 1 callersFunctionarray_and_vec
()
exercises/05_vecs/vecs1.rs:1
↓ 1 callersMethodcall
(&self)
solutions/08_enums/enums2.rs:19
↓ 1 callersMethodcall
(&self)
exercises/08_enums/enums2.rs:13
↓ 1 callersFunctioncall_me
(num: u8)
solutions/02_functions/functions3.rs:1
↓ 1 callersFunctioncall_me
一个名为`call_me`的函数,该函数没有参数且没有返回值。
solutions/02_functions/functions1.rs:2
↓ 1 callersFunctioncall_me
函数参数的类型必须进行标注。 添加类型注解 `u64`。
solutions/02_functions/functions2.rs:3
↓ 1 callersFunctioncall_me
TODO: 在 `:` 后添加参数 `num` 缺失的类型。
exercises/02_functions/functions2.rs:2
↓ 1 callersMethodchange_color
(&mut self, red: u8, green: u8, blue: u8)
solutions/08_enums/enums3.rs:39
↓ 1 callersFunctioncount_for
(map: &HashMap<String, Progress>, value: Progress)
solutions/18_iterators/iterators5.rs:15
↓ 1 callersFunctioncount_iterator
(map: &HashMap<String, Progress>, value: Progress)
solutions/18_iterators/iterators5.rs:25
↓ 1 callersFunctioncreate_order_template
()
solutions/07_structs/structs2.rs:12
↓ 1 callersFunctioncreate_order_template
()
exercises/07_structs/structs2.rs:12
↓ 1 callersFunctioncurrent_favorite_color
()
solutions/09_strings/strings1.rs:1
↓ 1 callersFunctioncurrent_favorite_color
TODO: 在不改变函数签名的前提下,修复编译器错误。
exercises/09_strings/strings1.rs:2
↓ 1 callersMethodecho
(&mut self, s: String)
solutions/08_enums/enums3.rs:35
↓ 1 callersFunctionfill_vec
(mut vec: Vec<i32>)
solutions/06_move_semantics/move_semantics3.rs:1
↓ 1 callersFunctionfill_vec
(vec: Vec<i32>)
solutions/06_move_semantics/move_semantics1.rs:1
↓ 1 callersFunctionfill_vec
(vec: Vec<i32>)
solutions/06_move_semantics/move_semantics2.rs:1
↓ 1 callersFunctionfill_vec
TODO: 在不添加任何新的一行的情况下修复函数中的编译器错误。
exercises/06_move_semantics/move_semantics3.rs:2
↓ 1 callersFunctionfill_vec
TODO: 修改这个函数中的编译器错误。
exercises/06_move_semantics/move_semantics1.rs:2
↓ 1 callersFunctionfill_vec
(vec: Vec<i32>)
exercises/06_move_semantics/move_semantics2.rs:1
↓ 1 callersFunctionget_char
借用(Borrows)而不是获取所有权(ownership)。 在这里,建议使用 `&str` 而不是 `&String`。但目前这样就ok,因为我们还没有处理字符串相关的内容。
solutions/06_move_semantics/move_semantics5.rs:5
↓ 1 callersFunctionget_char
不应该取得所有权
exercises/06_move_semantics/move_semantics5.rs:7
↓ 1 callersFunctionget_secret_recipe
()
solutions/10_modules/modules1.rs:2
↓ 1 callersFunctionget_secret_recipe
不要让此模块之外的任何人看到我们的秘方(`get_secert_recipe`)!
exercises/10_modules/modules1.rs:4
↓ 1 callersFunctionis_a_color_word
(attempt: &str)
solutions/09_strings/strings2.rs:1
↓ 1 callersFunctionis_a_color_word
TODO: 在不修改此函数的情况下,修复 `main` 函数中的编译器错误。
exercises/09_strings/strings2.rs:2
↓ 1 callersFunctionis_even
(num: i64)
solutions/02_functions/functions4.rs:1
↓ 1 callersFunctionis_even
(num: i64)
exercises/02_functions/functions4.rs:6
↓ 1 callersFunctionlongest
不要修改此函数。
exercises/16_lifetimes/lifetimes2.rs:2
↓ 1 callersFunctionmake_sausage
在 `fn` 前添加 `pub` 使其在模块外部可被访问。
solutions/10_modules/modules1.rs:7
↓ 1 callersFunctionmake_sausage
()
exercises/10_modules/modules1.rs:8
↓ 1 callersFunctionmaybe_ice_cream
此函数返回冰箱中剩余的冰淇淋数量。 在22:00(24小时制)之前,冰淇淋还剩下5勺。 在22:00时,有人会把冰淇淋全部吃完,所以就没有剩余(值为0)。 如果 `hour_of_day` 大于23,则返回 `None`。
solutions/12_options/options1.rs:5
↓ 1 callersFunctionmaybe_icecream
此函数返回冰箱中剩余的冰淇淋数量。 在22:00(24小时制)之前,冰淇淋还剩下5勺。 在22:00时,有人会把冰淇淋全部吃完,所以就没有剩余(值为0)。 如果 `hour_of_day` 大于23,则返回 `None`。
exercises/12_options/options1.rs:5
↓ 1 callersMethodmove_position
(&mut self, point: Point)
solutions/08_enums/enums3.rs:31
↓ 1 callersFunctionnum_sq
使用 `as_mut()` 并对一个数字进行求平方操作。
solutions/23_conversions/as_ref_mut.rs:18
↓ 1 callersFunctionnum_sq
使用 `as_mut()` 并对一个数字进行求平方操作。 TODO: 添加特征约束。
exercises/23_conversions/as_ref_mut.rs:21
↓ 1 callersMethodother_function
(&self)
solutions/15_traits/traits5.rs:8
↓ 1 callersMethodother_function
(&self)
exercises/15_traits/traits5.rs:8
↓ 1 callersMethodquit
(&mut self)
solutions/08_enums/enums3.rs:43
↓ 1 callersMethodresize
(&mut self, width: u64, height: u64)
solutions/08_enums/enums3.rs:26
↓ 1 callersMethodresize
(&mut self, width: u64, height: u64)
exercises/08_enums/enums3.rs:25
↓ 1 callersFunctionsend_tx
(q: Queue, tx: mpsc::Sender<u32>)
solutions/20_threads/threads3.rs:17
↓ 1 callersFunctionsend_tx
(q: Queue, tx: mpsc::Sender<u32>)
exercises/20_threads/threads3.rs:17
↓ 1 callersMethodsome_function
(&self)
solutions/15_traits/traits5.rs:2
↓ 1 callersMethodsome_function
(&self)
exercises/15_traits/traits5.rs:2
↓ 1 callersFunctionsquare
(num: i32)
solutions/02_functions/functions5.rs:1
↓ 1 callersFunctionsquare
TODO: 修改函数体,但不要修改函数签名。
exercises/02_functions/functions5.rs:2
↓ 1 callersFunctionstring_uppercase
获取所有权,而不是借用。
solutions/06_move_semantics/move_semantics5.rs:10
↓ 1 callersFunctionstring_uppercase
应该取得所有权
exercises/06_move_semantics/move_semantics5.rs:12
↓ 1 callersFunctiontotal_cost
不要修改此函数。
solutions/13_error_handling/errors3.rs:7
↓ 1 callersFunctiontotal_cost
不要修改此函数。
exercises/13_error_handling/errors3.rs:7
↓ 1 callersFunctionvec_loop
(input: &[i32])
solutions/05_vecs/vecs2.rs:1
↓ 1 callersFunctionvec_loop
(input: &[i32])
exercises/05_vecs/vecs2.rs:1
↓ 1 callersFunctionvec_map
(input: &[i32])
solutions/05_vecs/vecs2.rs:27
↓ 1 callersFunctionvec_map
(input: &[i32])
exercises/05_vecs/vecs2.rs:28
↓ 1 callersFunctionvec_map_example
(input: &[i32])
solutions/05_vecs/vecs2.rs:11
↓ 1 callersFunctionvec_map_example
(input: &[i32])
exercises/05_vecs/vecs2.rs:12
Functionall_fruit_types_in_basket
()
solutions/11_hashmaps/hashmaps2.rs:75
Functionall_fruit_types_in_basket
()
exercises/11_hashmaps/hashmaps2.rs:75
Functionanimal_habitat
(animal: &str)
solutions/03_if/if3.rs:1
Functionanimal_habitat
(animal: &str)
exercises/03_if/if3.rs:1
Functionat_least_five_fruits
()
solutions/11_hashmaps/hashmaps1.rs:37
Functionat_least_five_fruits
()
exercises/11_hashmaps/hashmaps1.rs:35
Functionat_least_five_types_of_fruits
()
solutions/11_hashmaps/hashmaps2.rs:59
Functionat_least_five_types_of_fruits
()
exercises/11_hashmaps/hashmaps2.rs:59
next →1–100 of 673, ranked by callers