-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Сделал метод place_bet для betclub2 #87
Conversation
feat(base/session) |
let event = state.events.iter().find(|e| e.Id == offer.inner_id as u32).unwrap(); | ||
let market = event.get_market().unwrap(); | ||
|
||
let basket = if outcome.0 == event.TeamsGroup[0] {&market.Rates[0].AddToBasket} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробелы после {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как это можно на match
переписать?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event.TeamsGroup[..]
не константа, так что никак
}}"#, | ||
event_id = basket.eId, | ||
bet_id = basket.bId, | ||
hand_size = match basket.fs { Some(v) => v.to_string(), _ => "null".to_string() }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А &v не сработало что ли?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope
return Err(Error::from(format!("Could not place a bet: {}", string))); | ||
} | ||
|
||
Ok(()) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У тебя short polling, так что ещё реализовать check_offer нужно
try!(response.read_to_string(&mut string)); | ||
|
||
if !string.contains("AmountIn") { | ||
return Err(Error::from(format!("Could not place a bet: {}", string))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут префикс could not place... Лишний, это задача вызывающей функции
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А ещё я думаю, что лучше From::from вместо Error::from, ибо испортить не надо и гибче. Это вопрос стиля, так что давай определимся
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Но и у Error::from преимущества. Как думаешь?
@loyd, обновил |
bd18f51
to
8e0d9a8
Compare
Close #19