skerkour / kerkour.com

(Ab)using technology for fun & profit. Programming, Hacking & Entrepreneurship @ https://kerkour.com
https://kerkour.com
Apache License 2.0
463 stars 63 forks source link

Rust File Encryption: Use of unstable library feature 'array_methods' #5

Closed Shadorain closed 2 years ago

Shadorain commented 2 years ago

image Hey Kerkour! Appreciate the blog posts and projects you have. Was going through the rust_file_encryption one and I'm getting a problem with slicing the buffer at lines 116 and 151 (via .as_slice()). Just letting you know that it is not building right :) thanks!

sylvain101010 commented 2 years ago

Hi @Shadorain Thanks for the heads up!

It seems that you have an older version of Rust installed, as of Rust 1.57.0, .as_slice is no longer an unstable feature (https://doc.rust-lang.org/std/primitive.array.html#method.as_slice).

You can update to the latest version of Rust with rustup update.

Alternatively, if you don't want to update, you can use &buffer[..read_count]

Sylvain ✌️

Shadorain commented 2 years ago

Apologies for that! Just switched back to my desktop which I haven't used since been away at school and never updated Rust! Thanks for the help there, didn't mean to bother!

sylvain101010 commented 2 years ago

No worries, Happy end of the year :)