Skip to content

Redox support #477

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

Merged
merged 1 commit into from
Jan 14, 2019
Merged

Redox support #477

merged 1 commit into from
Jan 14, 2019

Conversation

jackpot51
Copy link
Contributor

@jackpot51 jackpot51 commented Jan 14, 2019

Redox uses file: at the beginning of any file paths. Therefore, a path like file:///home/user/some%20file.txt needs to turn into file:/home/user/some file.txt


This change is Reviewable

@SimonSapin
Copy link
Member

The initial value of bytes is the only difference with the Unix variant of this function, right? I’d prefer we keep a single function and use something like let mut bytes = if cfg!(target_os = "redox") { b"file:".to_vec() } else { Vec::new() };, to reduce code duplication.

Does the path_to_file_url_segments function need any corresponding change?

@jackpot51
Copy link
Contributor Author

Good point, I can do that

@jackpot51
Copy link
Contributor Author

I will check path_to_file_url_segments

@jackpot51
Copy link
Contributor Author

jackpot51 commented Jan 14, 2019

I cleaned up the patch. It is the best I can do so far. There is not much I can do with path_to_file_url_segments until this issue is solved: rust-lang/rust#52331

I would recommend that this PR is merged and I can create an issue to update the other function when possible.

@SimonSapin
Copy link
Member

Thanks!

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 01404b7 has been approved by SimonSapin

@bors-servo
Copy link
Contributor

⌛ Testing commit 01404b7 with merge a1d8c88...

bors-servo pushed a commit that referenced this pull request Jan 14, 2019
Redox support

Redox uses `file:` at the beginning of any file paths. Therefore, a path like `file:///home/user/some%20file.txt` needs to turn into `file:/home/user/some file.txt`

<!-- 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/477)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - checks-travis
Approved by: SimonSapin
Pushing a1d8c88 to master...

@bors-servo bors-servo merged commit 01404b7 into servo:master Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants