mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 21:24:53 +08:00
[Rust] make rust part more idomatic and fix panic of backtrack template (#1370)
* Drop unused variable * Idiomatic rust * Fix panic template
This commit is contained in:
@ -74,7 +74,6 @@ fn find(nums: &[i32], target: i32) -> Option<usize> {
|
||||
fn main() {
|
||||
/* 初始化数组 */
|
||||
let arr: [i32; 5] = [0; 5];
|
||||
let slice: &[i32] = &[0; 5];
|
||||
print!("数组 arr = ");
|
||||
print_util::print_array(&arr);
|
||||
// 在 Rust 中,指定长度时([i32; 5])为数组,不指定长度时(&[i32])为切片
|
||||
|
||||
Reference in New Issue
Block a user