Skip to content

Commit

Permalink
Merge pull request #3 from Luro02/master
Browse files Browse the repository at this point in the history
Implement common traits for structures and update dependencies
  • Loading branch information
luleyleo authored Mar 8, 2019
2 parents 16fc7a6 + 8d1e8f3 commit 8d7b2c3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ version = "0.2.1"
authors = ["Leopold Luley <[email protected]>"]

[dependencies]
chrono = "0.4.0"
chrono = "0.4"
reqwest = "0.8.5"
serde = "1.0.29"
serde_derive = "1.0.29"
serde_json = "1.0.11"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
2 changes: 1 addition & 1 deletion src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use chrono::{NaiveDate, Datelike, Duration, Local};
use std::ops::Deref;
use std::fmt;

#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub struct UntisDate(NaiveDate);

impl UntisDate {
Expand Down
20 changes: 10 additions & 10 deletions src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct RpcResponse<R> {
pub result: R,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SessionInfo {
pub session_id: String,
Expand All @@ -21,13 +21,13 @@ pub struct SessionInfo {
pub person_type: usize,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq, Debug, Default, Serialize, Deserialize)]
pub struct StatusData {
pub lstypes: Vec<HashMap<String, StatusDataItem>>,
pub codes: Vec<HashMap<String, StatusDataItem>>,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StatusDataItem {
pub fore_color: String,
Expand All @@ -36,7 +36,7 @@ pub struct StatusDataItem {

pub type Holidays = Vec<HolidaysItem>;

#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HolidaysItem {
pub id: usize,
Expand All @@ -48,7 +48,7 @@ pub struct HolidaysItem {

pub type Rooms = Vec<RoomItem>;

#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RoomItem {
pub id: usize,
Expand All @@ -63,7 +63,7 @@ pub struct RoomItem {

pub type Classes = Vec<ClassItem>;

#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ClassItem {
pub id: usize,
Expand All @@ -83,7 +83,7 @@ pub struct ClassItem {

pub type Subjects = Vec<SubjectItem>;

#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SubjectItem {
pub id: usize,
Expand All @@ -97,7 +97,7 @@ pub struct SubjectItem {

pub type Timetable = Vec<TimetableItem>;

#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TimetableItem {
pub id: usize,
Expand All @@ -124,7 +124,7 @@ pub struct TimetableItem {
pub activity_type: String,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Serialize, Deserialize)]
pub struct IdItem {
pub id: isize,

Expand All @@ -133,7 +133,7 @@ pub struct IdItem {

pub type Departments = Vec<DepartmentItem>;

#[derive(Debug, Serialize, Deserialize)]
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DepartmentItem {
pub id: usize,
Expand Down
2 changes: 1 addition & 1 deletion src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use chrono::NaiveTime;
use std::ops::Deref;
use std::fmt;

#[derive(Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub struct UntisTime(NaiveTime);

impl Deref for UntisTime {
Expand Down
2 changes: 1 addition & 1 deletion src/untis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ fn make_untis_url(server: &str, school: &str) -> String {
server,
school
)
}
}

0 comments on commit 8d7b2c3

Please sign in to comment.