-
Notifications
You must be signed in to change notification settings - Fork 28
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
Edit Chapter 13 #35
Edit Chapter 13 #35
Conversation
I made no changes to the text about it, but I'm getting a warning at this point. warning: fields `txid`, `output_index`, `script_sig`, and `sequence` are never read
--> src/main.rs:5:5
|
4 | struct Input {
| ----- fields in this struct
5 | txid: [u8; 32],
| ^^^^
6 | output_index: u32,
| ^^^^^^^^^^^^
7 | script_sig: Vec<u8>,
| ^^^^^^^^^^
8 | sequence: u32,
| ^^^^^^^^
|
= note: `Input` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
warning: `transaction-decoder` (bin "transaction-decoder") generated 1 warning |
Yeah probably worth mentioning that the compiler will give warning messages at this point since we're not doing anything with the struct yet. |
57400ab
to
2ce2469
Compare
I added a |
@@ -147,9 +173,11 @@ struct Input { | |||
} | |||
``` | |||
|
|||
And voila! That works now and is much cleaner isn't it? | |||
And voila! That works now and is much cleaner isn't it? | |||
The attribute `#[allow(dead_code)]` is a hint to the compiler that we know we are not using the struct fields right now, but we will in the next section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh good idea 👍
Ack 2ce2469 |
Please take a separate look at these commits:
950b6fe: following #34 renaming, so it is consistent here. Will probably be necessary in the whole text going forward...
57400ab: I could not compile without it since we are pusshing into the vector, which requires it to be declared
mut
.