Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
limuy2022 committed May 12, 2024
1 parent 216b734 commit 63b0b37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion stdlib/src/ds/ac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ impl AcAutomaton {
// 正常的ac自动机会将剩余的失配部分也指向失配指针
// 但是这个字符集被设计为无限大,可以容纳unicode的ac自动机,所以不能这么做
// 会在匹配时顺着向上找失配指针
self.states[*val]._fail = if self.states[self.states[u]._fail].next.contains_key(c) {
self.states[*val]._fail = if self.states[self.states[u]._fail].next.contains_key(c)
{
self.states[self.states[u]._fail].next[c]
} else {
0
Expand Down
8 changes: 5 additions & 3 deletions stdlib/src/ds/splay.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
struct Node {

struct Node {
sons: [usize; 2],
cnt: usize,
sz: usize,
Expand Down Expand Up @@ -26,8 +27,9 @@ impl Splay {
}

pub fn maintain(&mut self, id: usize) {
self.tree[id].sz =
self.tree[self.tree[id].sons[0]].sz + self.tree[self.tree[id].sons[1]].sz + self.tree[id].cnt;
self.tree[id].sz = self.tree[self.tree[id].sons[0]].sz
+ self.tree[self.tree[id].sons[1]].sz
+ self.tree[id].cnt;
}

pub fn is_right(&self, id: usize) -> bool {
Expand Down

0 comments on commit 63b0b37

Please sign in to comment.