-
Notifications
You must be signed in to change notification settings - Fork 29
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
Decentralizing: Removing big centralized Value #520
Conversation
r=me for WebPush. |
thinkerbell lgtm |
@@ -4,6 +4,8 @@ | |||
#![plugin(clippy)] | |||
// To prevent clippy being noisy with derive(...) | |||
#![allow(used_underscore_binding)] | |||
#![allow(let_unit_value)] // For some reason, clippy decides to display this warning, without |
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.
nit: finish that sentence and remove extra blank line.
r=me thanks! |
udn = String::from(&udn[5..]); | ||
} | ||
.trim_left_matches("uuid:") | ||
.to_owned(); |
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.
nit: Thanks for the rewrite. I'd probably put the comment in front of the let. I think the comment in the middle of a statement looks funny.
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.
Note that I rewrote that only because Clippy kept pestering me about the style of this statement.
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.
I filed a bug with clippy, and it's been fixed in the latest version (not sure when it will be released).
See: https://github.com/Manishearth/rust-clippy/issues/975
Looks like it should be fixed in release 0.0.72
r=me for camera stuff. |
Adding:
|
Adding r? @npark-mozilla for integration tests. Also, @azasypkin , you can now look at the integration tests to see the API changes. |
r+ for the Hue changes and the changes to the Color type. |
fn should_send(&self, value: &Value, _: EventType) -> bool { | ||
self.contains(value) | ||
self == value // FIXME: This won't scale up to interesting ranges. |
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.
what's the path forward with this FIXME? Maybe you could file an issue and put the issue # here and above ?
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.
Well, this FIXME
is actually a reminder that should_send
only works for simple cases. For more complicated cases, well, a different algorithm will be needed. As I have no clue about which cases we are going to handle in the future, I don't really see how I can be much more specific.
f+ from the client side (app related PR is fxbox/app#172)! Just a few notes (maybe they are the same on master though, didn't check):
Currently we rely on |
@@ -168,7 +178,15 @@ impl ParseError { | |||
} | |||
|
|||
#[derive(Debug)] | |||
pub struct JSONError(error::Error); | |||
pub struct JSONError(pub error::Error); |
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.
just wondering why you need the "pub" for the argument ?
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.
Er... I don't remember, but I remember that I do :)
Almost sure that's not new. Looks like something that should be solved as part of #519.
Good idea, shouldn't be too hard. Can you file an issue? |
} | ||
} | ||
} | ||
mopafy!(Data); |
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.
so that I understand properly, this is how we'll let adapters implement their own data types ?
Mopa is like an "open" enum ?
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.
Basically, yes. Mopa is a more flexible + type-safe Any
that can be used much more comfortably to implement an open enum.
/// A human-readable description of the _type_ of the value. | ||
/// | ||
/// Used mainly in `TypeError` error messages. | ||
fn description() -> String where Self: Sized; |
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.
wondering if this could be a &'static str
like for Errors ?
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.
actually I don't really care so just forget this comment :)
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.
It makes things a bit more complicated for Range<T>
, unfortunately.
r=me, I left some nits and questions but not really important. We noticed that a DoorLock now uses Open/Closed instead of Locked/Unlocked, and I found that's because |
Done #522! |
r+ for me. glad to see the syntax got simpler. It would be awesome if the wiki (https://wiki.mozilla.org/Connected_Devices/Projects/Project_Link/Taxonomy) is updated as well :) |
I'll fix this. |
r=me for tts |
This PR removes the big centralized enum
Value
, effectively ending all centralization in Taxonomy. The first two beneficiaries are Thinkerbell (which now defines its own value typeRuleSource
) and WebPush (which now defines its own value typeWebPushNotify
).I still have a few PRs planned after this lands, but at this stage, Taxonomy will be Decentralized \o/