Reorder Bar struct

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-03-19 15:48:45 +00:00
parent b7a175d5b4
commit 718e794f51
3 changed files with 3 additions and 3 deletions

View File

@@ -26,8 +26,8 @@ pub struct Bar {
impl From<(Bar, String)> for types::Bar {
fn from((bar, symbol): (Bar, String)) -> Self {
Self {
time: bar.time,
symbol,
time: bar.time,
open: bar.open,
high: bar.high,
low: bar.low,

View File

@@ -28,8 +28,8 @@ pub struct Message {
impl From<Message> for Bar {
fn from(bar: Message) -> Self {
Self {
time: bar.time,
symbol: bar.symbol,
time: bar.time,
open: bar.open,
high: bar.high,
low: bar.low,

View File

@@ -4,9 +4,9 @@ use time::OffsetDateTime;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Row)]
pub struct Bar {
pub symbol: String,
#[serde(with = "clickhouse::serde::time::datetime")]
pub time: OffsetDateTime,
pub symbol: String,
pub open: f64,
pub high: f64,
pub low: f64,