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

method to_base64 add redundant quotations #92

Open
mahdi739 opened this issue Sep 16, 2023 · 0 comments
Open

method to_base64 add redundant quotations #92

mahdi739 opened this issue Sep 16, 2023 · 0 comments

Comments

@mahdi739
Copy link

mahdi739 commented Sep 16, 2023

Code to reproduce:

String::from_utf8(base64::engine::general_purpose::URL_SAFE_NO_PAD.decode("123".to_base64().unwrap() .as_ref()).unwrap()).unwrap();

Expected output:

123

Actual output:

"123"

It works correctly with the inner method from_base64, I assume it's because of using serde_json::to_vec and serde_json::from_slice implicitly in to_base64 and from_base64.

I don't know if it does that on purpose and make sense for internal usage. But because it's a public API I think It'd be better to be usable from other crates.

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

1 participant