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

variable as Vec<PathBuf> where paths could contain commas? #14

Open
Boscop opened this issue Jul 7, 2018 · 2 comments
Open

variable as Vec<PathBuf> where paths could contain commas? #14

Boscop opened this issue Jul 7, 2018 · 2 comments

Comments

@Boscop
Copy link

Boscop commented Jul 7, 2018

The readme says that it supports parsing into Vec by separating the values by commas.
If I want to parse a variable as Vec<PathBuf> where each path could contain commas, would it work by putting that path in single quotes?
E.g.

FOLDERS='C:\Foo,Bar',D:\Baz

resulting in vec![r"C:\Foo,Bar", r"D:\Baz"]?

And if there is a space after the separating comma, it won't work, right?

@softprops
Copy link
Owner

Hi @Boscop thanks for reaching out. Very interesting usecase.

Envy leverages a type called IntoDersializer to deserialize spefic types. Without looking closely I would have believe types that derive deserialize may get this for free. I see an impl of derialize for pathbuf here

I don't have tests for values containing commas for types derserializing into vecs so this may be a blindspot in the crate.

I think it's a solvable problem though. I'll take a look. Let me know if you have ideas.

@Boscop
Copy link
Author

Boscop commented Jul 9, 2018

I've used PathBuf with envy before, but the question is mainly about how to separate them with commas when some values can contain commas. It would also apply to Vec<String> etc.

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

No branches or pull requests

2 participants