Skip to content
This repository has been archived by the owner on Mar 1, 2019. It is now read-only.

Use PathBuf instead of String where appropiate #7

Open
jonasbb opened this issue Sep 1, 2017 · 3 comments
Open

Use PathBuf instead of String where appropiate #7

jonasbb opened this issue Sep 1, 2017 · 3 comments

Comments

@jonasbb
Copy link

jonasbb commented Sep 1, 2017

CratePreludeData.crate_root and ExternalCrateData.file_name both store file paths, so using PathBuf as the type would semantically make more sense.

@nrc
Copy link
Member

nrc commented Sep 4, 2017

iirc there was some issues with serialising these types

@Xanewok
Copy link
Collaborator

Xanewok commented Oct 21, 2017

These are serialized as an array of bytes in JSON, and is used now for SpanData::file_name.
Is the representation something that would require 'fixing' on the rustc-serialize side?
I assume it's encoded as bytes to handle platform differences with path/string representations but it seems to be working now.
Should we, then, avoid using PathBuf with rustc-serialize altogether or change some Strings to PathBufs and possibly change the JSON representation?

@kamalmarhubi
Copy link
Contributor

kamalmarhubi commented Feb 23, 2018

Assuming that #15 is accepted, moving to serde with custom serialize_with / deserialize_with becomes an option.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants