![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
rust
文章平均质量分 67
jesus_H
这个作者很懒,什么都没留下…
展开
-
用 rust 写算法
冒泡排序use std::io::*;fn main() { let mut str_buf = String::new(); stdin().read_line(&mut str_buf).expect("failed to read"); str_buf.clear(); stdin().read_line(&mut str_buf).expect("failed to read"); let num_arr: Vec<i32>原创 2021-09-08 13:22:24 · 250 阅读 · 0 评论 -
Rust 学习笔记——智能指针
https://doc.rust-lang.org/book/ch15-00-smart-pointers.html智能指针是一种想指针一样的行为且具有其他能力的数据结构(Smart pointers, on the other hand, are data structures that not only act like a pointer but also have additional metadata and capabilities.)在 Rust 中,智能指针和引用最大的区别在于:智能指.原创 2021-02-08 20:01:18 · 808 阅读 · 0 评论 -
Rust学习笔记——模式和匹配
https://doc.rust-lang.org/book/ch18-00-patterns.html模式有以下几种类型:LiteralsDestructured arrays, enums, structs, or tuplesVariablesWildcardsPlaceholders模式是什么 && 在哪里使用模式模式在 Rust 中很常见,比如我们常用的赋值语句也使用了模式:let x = 5;,x 就是一个模式,Rust 会将表达式的值和模式进行比较,如果.原创 2021-02-09 16:44:11 · 728 阅读 · 0 评论