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

Allow cli prefs to have numerical value #14863

Merged
merged 1 commit into from Jan 5, 2017
Merged

Conversation

@charlesvdv
Copy link
Contributor

charlesvdv commented Jan 5, 2017

I'm not sure as I'm new with servo but shouldn't the new function parse_opt_prefs be in prefs.rs instead of opts.rs ?


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #14842
  • There are tests for these changes OR

This change is Reviewable

@highfive
Copy link

highfive commented Jan 5, 2017

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Ms2ger (or someone else) soon.

@Ms2ger
Copy link
Contributor

Ms2ger commented Jan 5, 2017

r? @jdm

@highfive highfive assigned jdm and unassigned Ms2ger Jan 5, 2017
Copy link
Member

jdm left a comment

Nice tests! I only have a couple of suggestions.

match value {
Some(&"false") => PREFS.set(pref_name, PrefValue::Boolean(false)),
Some(&"true") | None => PREFS.set(pref_name, PrefValue::Boolean(true)),
_ => {

This comment has been minimized.

@jdm

jdm Jan 5, 2017

Member

Let's use

Some(value) => match value.parse::<f64>() {
    ...
},
@@ -946,6 +939,22 @@ pub fn set_defaults(opts: Opts) {
}
}

pub fn parse_opt_prefs(pref: &str) {

This comment has been minimized.

@jdm

jdm Jan 5, 2017

Member

Let's call this parse_pref_from_command_line instead.

@charlesvdv charlesvdv force-pushed the charlesvdv:prefs branch from 91a8fb2 to 48bcd1a Jan 5, 2017
@charlesvdv charlesvdv force-pushed the charlesvdv:prefs branch from 48bcd1a to 6a22174 Jan 5, 2017
Fix for #14842.

Extract the code inside a function to unit-test it.
@charlesvdv
Copy link
Contributor Author

charlesvdv commented Jan 5, 2017

@jdm this should be OK

If you have another idea of work to do for me don't hesitate!

@jdm
Copy link
Member

jdm commented Jan 5, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jan 5, 2017

📌 Commit 6a22174 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jan 5, 2017

Testing commit 6a22174 with merge 42e28bf...

bors-servo added a commit that referenced this pull request Jan 5, 2017
Allow cli prefs to have numerical value

I'm not sure as I'm new with servo but shouldn't the new function ```parse_opt_prefs``` be in ```prefs.rs``` instead of ```opts.rs``` ?

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14842

<!-- Either: -->
- [X] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14863)
<!-- Reviewable:end -->
@bors-servo bors-servo merged commit 6a22174 into servo:master Jan 5, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@charlesvdv charlesvdv deleted the charlesvdv:prefs branch Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.