-
Notifications
You must be signed in to change notification settings - Fork 255
Conversation
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.
This looks great, thank you! There are two very minor improvements I've noted inline.
src/build.rs
Outdated
config.wait_to_build | ||
}; | ||
|
||
thread::sleep(Duration::from_millis(wait_to_build as u64)); |
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.
You could make the config option u64
and then you wouldn't need this cast.
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.
Sure. I need to add a new impl for ConfigType for that.
Should the variant name be "<unsigned 64bit integer>"?
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.
that sounds good
src/config.rs
Outdated
@@ -157,6 +157,7 @@ create_config! { | |||
build_bin: String, String::new(), false, "cargo check --bin <name>"; | |||
cfg_test: bool, true, false, "build cfg(test) code"; | |||
unstable_features: bool, false, false, "enable unstable features"; | |||
wait_to_build: usize, 500, false, "time between receiving a change notification and starting build"; |
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.
Could you add "in milliseconds" to the description please?
@@ -166,7 +163,12 @@ impl BuildQueue { | |||
let (tx, rx) = channel(); | |||
self.pending.lock().unwrap().push(tx); | |||
if priority == BuildPriority::Normal { | |||
thread::sleep(Duration::from_millis(WAIT_TO_BUILD)); | |||
let wait_to_build = { // Release lock before we sleep |
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.
Good catch!
Thanks for the PR! Do you know what you would like to work on next? I can suggest something if you'd like. |
No idea. Please do. |
I have a couple of suggestions, do either sound interesting? Let me know if you have any questions.
|
I think #252 would expose me to some more interesting bits of code. I'll try that first. |
Issue #364