Skip to content

Commit 88743b1

Browse files
committed
Resolve various warnings
core/src/core/id.rs: - We have documentation annotated macros that do Rust does not generate docs for chain/src/store.rs: - Resolves unused assignment warnings - These are resolved by removing no-operation conditions within 'else' branches. - Instead, we initialize 'prev_header' with 'None', and only populate on successful bool = true src/bin/tui/mining.rs: - Comment out variants in Mining tables that are never constructed - Looks like they were removed due to size constraints of TUI, Rust doesn't like the variants being present when not used
1 parent 3b58407 commit 88743b1

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

chain/src/store.rs

-4
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,6 @@ impl<'a> Iterator for DifficultyIter<'a> {
520520
} else {
521521
if let Some(ref store) = self.store {
522522
prev_header = store.get_previous_header(&head).ok();
523-
} else {
524-
prev_header = None;
525523
}
526524
}
527525

@@ -763,8 +761,6 @@ impl<'a> Iterator for BottleIter<'a> {
763761
} else {
764762
if let Some(ref store) = self.store {
765763
prev_header = store.get_previous_header(&head).ok();
766-
} else {
767-
prev_header = None;
768764
}
769765
}
770766

core/src/core/id.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ impl<H: Hashed> ShortIdentifiable for H {
7474
pub struct ShortId([u8; 6]);
7575

7676
impl DefaultHashable for ShortId {}
77-
/// We want to sort short_ids in a canonical and consistent manner so we can
78-
/// verify sort order in the same way we do for full inputs|outputs|kernels
79-
/// themselves.
77+
// We want to sort short_ids in a canonical and consistent manner so we can
78+
// verify sort order in the same way we do for full inputs|outputs|kernels
79+
// themselves.
8080
hashable_ord!(ShortId);
8181

8282
impl ::std::fmt::Debug for ShortId {

src/bin/tui/mining.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ enum StratumWorkerColumn {
4141
Id,
4242
IsConnected,
4343
LastSeen,
44-
PowDifficulty,
44+
// PowDifficulty,
4545
NumAccepted,
4646
NumRejected,
4747
NumStale,
@@ -54,7 +54,7 @@ impl StratumWorkerColumn {
5454
StratumWorkerColumn::Id => "Worker ID",
5555
StratumWorkerColumn::IsConnected => "Connected",
5656
StratumWorkerColumn::LastSeen => "Last Seen",
57-
StratumWorkerColumn::PowDifficulty => "PowDifficulty",
57+
// StratumWorkerColumn::PowDifficulty => "PowDifficulty",
5858
StratumWorkerColumn::NumAccepted => "Num Accepted",
5959
StratumWorkerColumn::NumRejected => "Num Rejected",
6060
StratumWorkerColumn::NumStale => "Num Stale",
@@ -79,7 +79,7 @@ impl TableViewItem<StratumWorkerColumn> for WorkerStats {
7979
StratumWorkerColumn::Id => self.id.clone(),
8080
StratumWorkerColumn::IsConnected => self.is_connected.to_string(),
8181
StratumWorkerColumn::LastSeen => datetime.to_string(),
82-
StratumWorkerColumn::PowDifficulty => self.pow_difficulty.to_string(),
82+
// StratumWorkerColumn::PowDifficulty => self.pow_difficulty.to_string(),
8383
StratumWorkerColumn::NumAccepted => self.num_accepted.to_string(),
8484
StratumWorkerColumn::NumRejected => self.num_rejected.to_string(),
8585
StratumWorkerColumn::NumStale => self.num_stale.to_string(),
@@ -95,7 +95,7 @@ impl TableViewItem<StratumWorkerColumn> for WorkerStats {
9595
StratumWorkerColumn::Id => Ordering::Equal,
9696
StratumWorkerColumn::IsConnected => Ordering::Equal,
9797
StratumWorkerColumn::LastSeen => Ordering::Equal,
98-
StratumWorkerColumn::PowDifficulty => Ordering::Equal,
98+
// StratumWorkerColumn::PowDifficulty => Ordering::Equal,
9999
StratumWorkerColumn::NumAccepted => Ordering::Equal,
100100
StratumWorkerColumn::NumRejected => Ordering::Equal,
101101
StratumWorkerColumn::NumStale => Ordering::Equal,
@@ -109,7 +109,7 @@ enum DiffColumn {
109109
Hash,
110110
PoWType,
111111
Difficulty,
112-
SecondaryScaling,
112+
// SecondaryScaling,
113113
Time,
114114
Duration,
115115
}
@@ -121,7 +121,7 @@ impl DiffColumn {
121121
DiffColumn::Hash => "Hash",
122122
DiffColumn::PoWType => "Algorithm",
123123
DiffColumn::Difficulty => "Network Difficulty",
124-
DiffColumn::SecondaryScaling => "Sec. Scaling",
124+
// DiffColumn::SecondaryScaling => "Sec. Scaling",
125125
DiffColumn::Time => "Block Time",
126126
DiffColumn::Duration => "Duration",
127127
}
@@ -138,7 +138,7 @@ impl TableViewItem<DiffColumn> for DiffBlock {
138138
DiffColumn::Hash => self.block_hash.to_string(),
139139
DiffColumn::PoWType => pow_type,
140140
DiffColumn::Difficulty => self.difficulty.to_string(),
141-
DiffColumn::SecondaryScaling => self.secondary_scaling.to_string(),
141+
// DiffColumn::SecondaryScaling => self.secondary_scaling.to_string(),
142142
DiffColumn::Time => format!("{}", datetime).to_string(),
143143
DiffColumn::Duration => format!("{}s", self.duration).to_string(),
144144
}
@@ -153,7 +153,7 @@ impl TableViewItem<DiffColumn> for DiffBlock {
153153
DiffColumn::Hash => Ordering::Equal,
154154
DiffColumn::PoWType => Ordering::Equal,
155155
DiffColumn::Difficulty => Ordering::Equal,
156-
DiffColumn::SecondaryScaling => Ordering::Equal,
156+
// DiffColumn::SecondaryScaling => Ordering::Equal,
157157
DiffColumn::Time => Ordering::Equal,
158158
DiffColumn::Duration => Ordering::Equal,
159159
}
@@ -190,9 +190,9 @@ impl TUIStatusListener for TUIMiningView {
190190
.column(StratumWorkerColumn::LastSeen, "Last Seen", |c| {
191191
c.width_percent(16)
192192
})
193-
// .column(StratumWorkerColumn::PowDifficulty, "Pow Difficulty", |c| {
194-
// c.width_percent(12)
195-
// })
193+
/*.column(StratumWorkerColumn::PowDifficulty, "Pow Difficulty", |c| {
194+
c.width_percent(12)
195+
})*/
196196
.column(StratumWorkerColumn::NumAccepted, "Num Accepted", |c| {
197197
c.width_percent(10)
198198
})
@@ -273,9 +273,9 @@ impl TUIStatusListener for TUIMiningView {
273273
.column(DiffColumn::Difficulty, "Difficulty", |c| {
274274
c.width_percent(20)
275275
})
276-
// .column(DiffColumn::SecondaryScaling, "Sec. Scaling", |c| {
277-
// c.width_percent(10)
278-
// })
276+
/*.column(DiffColumn::SecondaryScaling, "Sec. Scaling", |c| {
277+
c.width_percent(10)
278+
})*/
279279
.column(DiffColumn::Time, "Block Time", |c| c.width_percent(25))
280280
.column(DiffColumn::Duration, "Duration", |c| c.width_percent(25));
281281

0 commit comments

Comments
 (0)