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

systemd escaping #100

Open
kugland opened this issue Dec 23, 2021 · 1 comment
Open

systemd escaping #100

kugland opened this issue Dec 23, 2021 · 1 comment

Comments

@kugland
Copy link

kugland commented Dec 23, 2021

While implementing unescaping for systemd-escape strings, I figured out that
both the escaping and unescaping should take OsStr, not str, since those
strings are not necessarily UTF-8. Do you thing that is doable? Also, the functions
for escaping/unescaping paths should probably take &Path, but OsStr should
be OK too.

Also, if I submit my unescaping function as a pull request, would you consider
merging it?

Thanks,
André Kugland

@lucab
Copy link
Owner

lucab commented Dec 24, 2021

Hi and welcome, thanks for having a look at unescaping!
While you are technically right that inputs could be in non-UTF8 encodings, unless you have a very real and compelling usecase involving such inputs, it's reasonable to use str/String here. In the context of Rust and systemd in 2021, it is fair to make such assumptions about non-legacy environments.
Same goes for Path: as we can assume the target environment is a modern Linux, there is little to no interest for non-UNIX separators and weird encodings.

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