diff --git a/README.md b/README.md index 193b3735ae9992327a9d2f1bd61a7ca032b398f4..36d55f7f940ecd62bbd60a898e1ecc6f6ab399c4 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,40 @@ cargo run ## Description Will take the string from CODED and output the decoded string into PLAIN + +## Analysis + +3a with the slice-borrowing will fail with + +``` +Running `target/debug/a3_decode` +Time to decode! +Decoded: + +"But unto the wicked God saith, What hast thou to do to declare my statutes, or that thou shouldest take my covenant in thy mouth ?\u{0}" +``` + +while with branch 3b it detects it at compile time: + +``` +error[E0308]: mismatched types + --> src/main.rs:13:1 + | +13 | / [ 0x015e7a47, +14 | | 0x2ef84ebb, +15 | | 0x177a8db4, +16 | | 0x1b722ff9, +... | +143 | | 0xc2e41061 +144 | | ]; + | |_________^ expected an array with a fixed size of 132 elements, + | found one with 131 elements + | + = note: expected type `[u32; 132]` + found type `[u32; 131]` + +error: aborting due to previous error + +error: Could not compile `a3_decode`. +``` +