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

Implement to_path() to convert CFURLs to PathBufs. #122

Merged
merged 1 commit into from Oct 20, 2017

Conversation

@jrmuizel
Copy link
Collaborator

jrmuizel commented Oct 20, 2017

This lets us roundtrip Paths through CFURLs


This change is Reviewable

// implementing this on Windows is more complicated because of the different OsStr representation
unsafe {
let mut buf: [u8; PATH_MAX as usize] = mem::uninitialized();
CFURLGetFileSystemRepresentation(self.0, true as Boolean, buf.as_mut_ptr(), buf.len() as CFIndex);

This comment has been minimized.

@jdm

jdm Oct 20, 2017

Member

This returns false if an error occurred, so we should make this method return None if that occurs.

This lets us roundtrip Paths through CFURLs
@jrmuizel jrmuizel force-pushed the jrmuizel:to-path branch from 81282b2 to 21a2dde Oct 20, 2017
@jdm
Copy link
Member

jdm commented Oct 20, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

📌 Commit 21a2dde has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

Testing commit 21a2dde with merge a112585...

bors-servo added a commit that referenced this pull request Oct 20, 2017
Implement to_path() to convert CFURLs to PathBufs.

This lets us roundtrip Paths through CFURLs

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/122)
<!-- Reviewable:end -->
@jdm
jdm approved these changes Oct 20, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Oct 20, 2017

☀️ Test successful - status-travis
Approved by: jdm
Pushing a112585 to master...

@bors-servo bors-servo merged commit 21a2dde into servo:master Oct 20, 2017
2 of 3 checks passed
2 of 3 checks passed
code-review/reviewable 1 file, 1 discussion left (jdm)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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.

None yet

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