mirror of
https://framagit.org/veretcle/oolatoocs.git
synced 2025-07-21 13:24:18 +02:00
fix: use u16 instead of i64
This commit is contained in:
@@ -49,7 +49,7 @@ struct TweetReply {
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct TweetPoll {
|
||||
pub options: Vec<String>,
|
||||
pub duration_minutes: i64,
|
||||
pub duration_minutes: u16,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
@@ -435,7 +435,8 @@ pub fn transform_poll(p: &Poll) -> TweetPoll {
|
||||
|
||||
TweetPoll {
|
||||
options: p.options.iter().map(|i| i.title.clone()).collect(),
|
||||
duration_minutes: diff.num_minutes(),
|
||||
duration_minutes: diff.num_minutes().try_into().unwrap(), // safe here, number is positive
|
||||
// and can’t be over 21600
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user