Skip to content
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

Switch config to YAML #239

Merged
merged 10 commits into from
Feb 1, 2019
17 changes: 11 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#[derive(Debug, PartialEq, Eq)]
pub struct Config {
pub remote_machine: RemoteMachine,
pub compression: Compression,
pub remote: Remote,
pub push: Push,
pub pull: Pull,
}

#[derive(Debug, Eq, PartialEq)]
pub struct RemoteMachine {
pub struct Remote {
pub host: String,
}

#[derive(Debug, Eq, PartialEq)]
pub struct Compression {
pub local: i64,
pub remote: i64,
pub struct Push {
pub compression: i64,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still — i64 is too much.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to u8

}

#[derive(Debug, Eq, PartialEq)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need both Eq and PartialEq?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great question my friend!

I need equality for unit tests (assert_eq!())
In Rust Eq seems to be special case of PartialEq and most of things like assert_eq!() need PartialEq thus I definitely need to have PartialEq

Removed Eq 👍

pub struct Pull {
pub compression: i64,
}
Loading