Browse Source

make `Side` repr(u8)

tags/v0.3.1
Jonathan Strong 4 years ago
parent
commit
1d705c2259
2 changed files with 4 additions and 3 deletions
  1. +1
    -1
      Cargo.toml
  2. +3
    -2
      src/crypto.rs

+ 1
- 1
Cargo.toml View File

@@ -1,6 +1,6 @@
[package] [package]
name = "markets" name = "markets"
version = "0.3.0"
version = "0.3.1"
authors = ["Jonathan Strong <jonathan.strong@gmail.com>"] authors = ["Jonathan Strong <jonathan.strong@gmail.com>"]
edition = "2018" edition = "2018"
description = "kind of like the http crate, except about tradeable markets" description = "kind of like the http crate, except about tradeable markets"


+ 3
- 2
src/crypto.rs View File

@@ -39,10 +39,11 @@ macro_rules! t {
/// which side of the transaction (buying or selling) /// which side of the transaction (buying or selling)
/// a price/trade is /// a price/trade is
/// ///
#[repr(u8)]
#[derive(Debug, PartialEq, Clone, Copy, Eq, Serialize)] #[derive(Debug, PartialEq, Clone, Copy, Eq, Serialize)]
pub enum Side { pub enum Side {
Bid,
Ask
Bid = 1,
Ask = 2,
} }


impl TryFrom<u8> for Side { impl TryFrom<u8> for Side {


Loading…
Cancel
Save