Skip to content

Commit e75275c

Browse files
committed
duration u32
1 parent 895ee55 commit e75275c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rezvrh_scraper/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rezvrh_scraper"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
edition = "2021"
55
description = "Bakalari scraper"
66
license = "MIT-0"

rezvrh_scraper/src/modules/timetable/hour.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use thiserror::Error;
99
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
1010
pub struct Hour {
1111
pub start: NaiveTime,
12-
pub duration: u64,
12+
pub duration: u32,
1313
}
1414

1515
/// Hour parse error
@@ -67,7 +67,7 @@ impl Hour {
6767
let to = NaiveTime::parse_from_str(to, "%H:%M").map_err(ParseError::ParseTo)?;
6868
let duration = to - from;
6969
let duration = duration.num_minutes();
70-
let duration = u64::try_from(duration).map_err(|_| ParseError::InvertedFromTo)?;
70+
let duration = u32::try_from(duration).map_err(|_| ParseError::InvertedFromTo)?;
7171

7272
Ok(Self {
7373
start: from,

0 commit comments

Comments
 (0)