Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix up some issues flagged by clippy #294
Conversation
| let tmp = pieces[piece_pointer]; | ||
| pieces[piece_pointer] = pieces[compress_pointer + swaps - 1]; | ||
| pieces[compress_pointer + swaps - 1] = tmp; | ||
| pieces.swap(piece_pointer, compress_pointer + swaps - 1); |
This comment has been minimized.
This comment has been minimized.
lucab
May 9, 2017
•
Possibly out of scope of this PR, but I think both parameters would benefit from some bound checking to ensure no index underflow/overflow will induce a panic here at runtime.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
luisbg
May 16, 2017
Unfortunately this still appears as part of the clippy related changes.
Can you move this into a new branch?
This comment has been minimized.
This comment has been minimized.
dtolnay
May 16, 2017
This is a clippy related change. Bounds checking is a separate issue being tracked in #334.
This comment has been minimized.
This comment has been minimized.
vks
commented
May 9, 2017
|
What is the minimum Rust version that should be supported by rust-url? |
| @@ -26,7 +26,7 @@ fn check_invariants(url: &Url) { | |||
| } | |||
|
|
|||
|
|
|||
| fn run_parsing(input: String, base: String, expected: Result<ExpectedAttributes, ()>) { | |||
| fn run_parsing(input: &String, base: &String, expected: Result<ExpectedAttributes, ()>) { | |||
This comment has been minimized.
This comment has been minimized.
| @@ -1031,7 +1031,7 @@ impl<'a> Parser<'a> { | |||
| } | |||
| } | |||
| None => return Ok((None, None)), | |||
| _ => panic!("Programming error. parse_query_and_fragment() called without ? or # {:?}") | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
SimonSapin
May 20, 2017
Member
This compiles because the panic! macro has a special case for use with a single "argument" that by-passes the string formatting system entirely:
https://github.com/rust-lang/rust/blob/a0da1e0653/src/libstd/macros.rs#L43-L49
|
@vks + @Hoverbear + @dtolnay: I've switched it from &String to &str. Good to go? |
vks
commented
May 12, 2017
|
Great, looks good to me! |
luisbg
commented
May 16, 2017
|
Looks good Except that one change in src/host.rs that is more than pure style cleanup. Not sure if maintainers want that in a new branch or if it is OK as is. Thanks Daniel |
|
We have multiple good reviews so lets merge! |
|
|
|
@vks I’m not really keeping track of a minimum version. We’ll figure it out when/if someone complains :) This looks very nice. Thank you all! @bors-servo r+ |
|
|
Fix up some issues flagged by clippy <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/294) <!-- Reviewable:end -->
|
|
daniellockyer commentedApr 19, 2017
•
edited by larsbergstrom
This change is