rust_interview icon indicating copy to clipboard operation
rust_interview copied to clipboard

Rust面试题集锦

Results 7 rust_interview issues
Sort by recently updated
recently updated
newest added

```rust #![allow(dead_code)] fn main() { fn id(x: T) -> T { x } struct List { next: Option, } impl List { fn walk_the_list(&mut self) { let mut current =...

Questions-Practice

为什么使用这些类型? 这些类型有何异同? 构造这样的内存泄漏, 需要满足什么条件? 参考: 第二部分, 第17章 泄漏

Rust Nightly 1.22.0 ```rust use std::collections::BTreeMap; fn foo(_qux: &BTreeMap) -> Option { Some("baz".to_owned()) } fn main() { let mut map = BTreeMap::new(); map.insert("foo", "bar"); foo(&map).and_then( |baz| { let mut map...

Questions-Practice

```rust let c = move || { { let y_ref = &y; } x; y; z; }; ``` 假如x、y、z都是外部变量,那么上面闭包示例中,是先捕获y呢,还是先捕获z ?析构顺序是什么样的?

Questions-Advance

```rust fn main() { let a = [1, 2, 3]; let mut iter = a.iter(); assert_eq!(iter.any(|&x| x != 2), true); let sum = iter.fold(0, |acc, &x| acc + x); assert_eq!(sum,...

Questions-Practice

RT 考察点: 闭包相关/FnBox/DerefMove fn xx(self: Box)

Questions-Advance
Questions

考察对Rust的Sized trait的理解

Questions-Practice
Questions