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

WIP: more rust #3416

Closed
wants to merge 1 commit into from
Closed

WIP: more rust #3416

wants to merge 1 commit into from

Conversation

Ericson2314
Copy link
Member

I think I've become a bit accelerationist about this. If we have some Rust, we might as well have all the Rust. Polyglot is bad.

@@ -0,0 +1,163 @@
use crate::error::Error;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need our own base64 implementation, since there is a crate for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise for base16 - we can use the hex crate.

@@ -64,7 +65,7 @@ pub fn decode(input: &str) -> Result<Vec<u8>, crate::Error> {
let mut nr_bits_left: usize = 0;
let mut bits_left: u16 = 0;

for c in input.chars().rev() {
for c in input.chars() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, is this correct? IIRC we really do need to process it in reverse order (our base32 encoding is pretty quirky).

@edolstra
Copy link
Member

I suppose we have to decide whether we really want to go forward with Rust. Currently we only use it for one small type (StorePath) which could be easily rewritten in C++.

@Ericson2314
Copy link
Member Author

Yeah I thought this would help me do the CAS stuff, but then C++ wasn't so bad so I'll just leave this as is.

@Ericson2314 Ericson2314 changed the title WIP more rust WIP: more rust Mar 16, 2020
@Ericson2314
Copy link
Member Author

Closing if/until there is a big Rust push

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

Successfully merging this pull request may close these issues.

None yet

2 participants