feat: add rust docs (#815)

* feat: add rust docs

* Import std types for built_in_hash doc
This commit is contained in:
易春风
2023-10-01 19:25:03 +08:00
committed by GitHub
parent e8bf5879b0
commit cbe76b58a2
8 changed files with 162 additions and 12 deletions

View File

@@ -278,20 +278,16 @@
stack.push(4);
/* 访问栈顶元素 */
if let Some(top) = stack.get(stack.len() - 1) {
}
if let Some(top) = stack.last() {
}
let top = stack[stack.len() - 1];
/* 元素出栈 */
if let Some(pop) = stack.pop() {
}
let pop = stack.pop().unwrap();
/* 获取栈的长度 */
let size = stack.len();
/* 判断是否为空 */
let isEmpty = stack.is_empty();
let is_empty = stack.is_empty();
```
=== "C"