Skip to content
Snippets Groups Projects
Commit d87dcd4d authored by Per's avatar Per
Browse files

fix

parent 1afd13e7
No related branches found
No related tags found
No related merge requests found
......@@ -145,11 +145,11 @@ Seminars
You have to be careful about the signed/unsigned operations and use `wrapping` arithmetics to avoid panics due to unsigned *carry* and signed *overflow*.
Use borrowed array slices as arguments to `decode`.
Use borrowed array slices as arguments to `decode`.
The `seed`, `abc`,`coded` and `plain` should be stack allocated. The decoded string should be printed when decryption is finished.
b. Make the `seed`, `abc`,`coded` and `plain` heap allocated. Accessing those will require some `unsafe` code. (Keep the unsafe blocks as local as possible.)
b. Make the `seed`, `abc`,`coded` and `plain` heap allocated. Accessing those will require some `unsafe` code. (Keep the unsafe blocks as local as possible, perhaps you can do all in *safe* Rust.)
c. Safety analysis. Provoke the implementation, by omitting the `'\0'` (null termination). Observe the result and motivate the behavior in terms of your understanding of the Rust memory model. Under which circumstances do you consider 3a and 3b to have same/different memory safety.
......
......@@ -84,7 +84,6 @@ Thus, only for cases when *true* random access is desired/required, raw indexing
In short, the complilation process can be broken down to the following steps:
1. Parsing input
* this processes the .rs files and produces the AST ("abstract syntax tree")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment