wisespace-io / binance-rs

Rust Library for the Binance API
Other
688 stars 305 forks source link

Unify kline data type #137

Closed siegfried closed 3 years ago

siegfried commented 3 years ago

Regarding #136, change the types of KlineSummary.

siegfried commented 3 years ago

I revert the reformat commit so that you can focus on the logic. Maybe you can run rustfmt after this is merged.

wisespace-io commented 3 years ago

@siegfried The build failed with a clippy warning/error, see below:

  error: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices
     --> src/model.rs:890:19
      |
  890 | fn get_value(row: &Vec<Value>, index: usize, name: &'static str) -> Result<Value> {
      |                   ^^^^^^^^^^^ help: change this to: `&[Value]`
      |
      = note: `-D clippy::ptr-arg` implied by `-D warnings`
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
siegfried commented 3 years ago

@wisespace-io Updated. Please retry. Not sure if it is related to your Rust compiler version. I cannot get the error locally.

$ rustc --version
rustc 1.56.1 (59eed8a2a 2021-11-01)
wisespace-io commented 3 years ago

@siegfried It seems to have fixed.

siegfried commented 3 years ago

Do you mind to run rustfmt to align the code? There are a few misalignment caused by different editor settings. @wisespace-io