Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QMHTMY/RustBook
/ clear
Method
clear
publication/code/chapter04/queue.rs:30–32 ·
view source on GitHub ↗
(&mut self)
Source
from the content-addressed store, hash-verified
28
}
29
30
fn clear(&mut self) {
31
self.data = Vec::with_capacity(self.cap);
32
}
33
34
// 判断是否有剩余空间、有则数据加入队列
35
fn enqueue(&mut self, val: T) -> Result<(), String> {
Callers
1
basic
Function · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected