From c3b7108f0257751973b1c3b18724c46ec209f022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= <henrik@tjaders.com> Date: Wed, 15 Nov 2017 13:52:51 +0100 Subject: [PATCH] Added readme to 3a --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 193b373..36d55f7 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`. +``` + -- GitLab