Skip to content

Commit d133b6d

Browse files
committed
Fix some compilation errors in CI
- Adjusted the indentation in documentation comments to ensure proper formatting. - Replaced legacy numeric constants with associated constants. - Removed unnecessary import of legacy numeric constants. Signed-off-by: hhwyt <[email protected]>
1 parent 7aa6365 commit d133b6d

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/lib.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ The `Ready` state contains quite a bit of information, and you need to check and
201201
by one:
202202
203203
1. Check whether `messages` is empty or not. If not, it means that the node will send messages to
204-
other nodes:
204+
other nodes:
205205
206206
```rust
207207
# use slog::{Drain, o};
@@ -226,7 +226,7 @@ other nodes:
226226
```
227227
228228
2. Check whether `snapshot` is empty or not. If not empty, it means that the Raft node has received
229-
a Raft snapshot from the leader and we must apply the snapshot:
229+
a Raft snapshot from the leader and we must apply the snapshot:
230230
231231
```rust
232232
# use slog::{Drain, o};
@@ -254,8 +254,8 @@ a Raft snapshot from the leader and we must apply the snapshot:
254254
```
255255
256256
3. Check whether `committed_entries` is empty or not. If not, it means that there are some newly
257-
committed log entries which you must apply to the state machine. Of course, after applying, you
258-
need to update the applied index and resume `apply` later:
257+
committed log entries which you must apply to the state machine. Of course, after applying, you
258+
need to update the applied index and resume `apply` later:
259259
260260
```rust
261261
# use slog::{Drain, o};
@@ -310,7 +310,7 @@ need to update the applied index and resume `apply` later:
310310
after restarting, *it may work but potential log loss may also be ignored silently*.
311311
312312
4. Check whether `entries` is empty or not. If not empty, it means that there are newly added
313-
entries but have not been committed yet, we must append the entries to the Raft log:
313+
entries but have not been committed yet, we must append the entries to the Raft log:
314314
315315
```rust
316316
# use slog::{Drain, o};
@@ -335,8 +335,8 @@ entries but have not been committed yet, we must append the entries to the Raft
335335
```
336336
337337
5. Check whether `hs` is empty or not. If not empty, it means that the `HardState` of the node has
338-
changed. For example, the node may vote for a new leader, or the commit index has been increased.
339-
We must persist the changed `HardState`:
338+
changed. For example, the node may vote for a new leader, or the commit index has been increased.
339+
We must persist the changed `HardState`:
340340
341341
```rust
342342
# use slog::{Drain, o};
@@ -360,7 +360,7 @@ We must persist the changed `HardState`:
360360
```
361361
362362
6. Check whether `persisted_messages` is empty or not. If not, it means that the node will send messages to
363-
other nodes after persisting hardstate, entries and snapshot:
363+
other nodes after persisting hardstate, entries and snapshot:
364364
365365
```rust
366366
# use slog::{Drain, o};
@@ -385,8 +385,8 @@ other nodes after persisting hardstate, entries and snapshot:
385385
```
386386
387387
7. Call `advance` to notify that the previous work is completed. Get the return value `LightReady`
388-
and handle its `messages` and `committed_entries` like step 1 and step 3 does. Then call `advance_apply`
389-
to advance the applied index inside.
388+
and handle its `messages` and `committed_entries` like step 1 and step 3 does. Then call `advance_apply`
389+
to advance the applied index inside.
390390
391391
```rust
392392
# use slog::{Drain, o};
@@ -470,8 +470,8 @@ This process is a two-phase process, during the midst of it the peer group's lea
470470
**two independent, possibly overlapping peer sets**.
471471
472472
> **Note:** In order to maintain resiliency guarantees (progress while a majority of both peer sets is
473-
active), it is recommended to wait until the entire peer group has exited the transition phase
474-
before taking old, removed peers offline.
473+
active), it is recommended to wait until the entire peer group has exited the transition phase
474+
before taking old, removed peers offline.
475475
476476
*/
477477

src/quorum/majority.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::collections::hash_set::Iter;
77
use std::fmt::Formatter;
88
use std::mem::MaybeUninit;
99
use std::ops::{Deref, DerefMut};
10-
use std::{cmp, slice, u64};
10+
use std::{cmp, slice};
1111

1212
/// A set of IDs that uses majority quorums to make decisions.
1313
#[derive(Clone, Debug, Default, PartialEq, Eq)]

src/raw_node.rs

+1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ impl Ready {
218218
/// MustSync is false if and only if
219219
/// 1. no HardState or only its commit is different from before
220220
/// 2. no Entries and Snapshot
221+
///
221222
/// If it's false, an asynchronous write of HardState is permissible before calling
222223
/// [`RawNode::on_persist_ready`] or [`RawNode::advance`] or its families.
223224
#[inline]

src/storage.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ mod test {
579579
new_entry(5, 5),
580580
new_entry(6, 6),
581581
];
582-
let max_u64 = u64::max_value();
582+
let max_u64 = u64::MAX;
583583
let mut tests = vec![
584584
(
585585
2,

src/util.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
use std::fmt;
77
use std::fmt::Write;
8-
use std::u64;
98

109
use slog::{OwnedKVList, Record, KV};
1110

0 commit comments

Comments
 (0)