MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / new

Method new

1472-design-browser-history.rs:8–13  ·  view source on GitHub ↗
(homepage: String)

Source from the content-addressed store, hash-verified

6impl BrowserHistory {
7
8 fn new(homepage: String) -> Self {
9 BrowserHistory {
10 his: vec![homepage.clone()],
11 idx: 0
12 }
13 }
14
15 fn visit(&mut self, url: String) {
16 self.his.truncate(self.idx + 1);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected