Clippy issue on new rust version

This commit is contained in:
Dagur Valberg Johannsson 2026-02-02 11:59:08 +01:00
parent 0388aa282e
commit 98a6d1a0bb
No known key found for this signature in database
GPG key ID: FD701804AEE88107

View file

@ -54,13 +54,14 @@ impl PriceInterval {
} }
pub fn to_candlestick_data(&self) -> Option<CandlestickData> { pub fn to_candlestick_data(&self) -> Option<CandlestickData> {
if self.transaction_count == 0 || self.open.is_none() || self.close.is_none() { if self.transaction_count == 0 {
None return None;
} else { }
Some(CandlestickData { Some(CandlestickData {
time: self.start, time: self.start,
open: self.open.unwrap(), open: self.open?,
close: self.close.unwrap(), close: self.close?,
high: self.high, high: self.high,
low: self.low, low: self.low,
volume_sats: self.volume_sats, volume_sats: self.volume_sats,
@ -68,7 +69,6 @@ impl PriceInterval {
transaction_count: self.transaction_count, transaction_count: self.transaction_count,
}) })
} }
}
pub fn end(&self) -> i64 { pub fn end(&self) -> i64 {
self.start + self.step self.start + self.step