Hello, so I've finished most of the book (~ Chapter 19) and wanted to move on to a project.
Got recommended this project: https://picklenerd.github.io/pngme_book/
Now, I made the file structure in lib.rs:
pub mod args;
pub mod chunk;
pub mod chunk_type;
pub mod commands;
pub mod png;
Currently, in chunk_type.rs I have this:
pub enum ChunkType {
Encrypted,
RawMessage,
}
impl ChunkType {
pub fn as_str(&self) -> &'static str {
match self {
ChunkType::Encrypted => "Encr",
ChunkType::RawMessage => "RMsg",
}
}
pub fn from_str(name: &str) -> Result<ChunkType, &'static str> {
match name {
"Encr" => Ok(ChunkType::Encrypted),
"RMsg" => Ok(ChunkType::RawMessage),
_ => Err("Not a valid chunk type!"),
}
}
}
And well, it warns me on every single item "xyz is never used". I don't think I am supposed to suppress the warning, right?
Have I done anything wrong? How to resolve this?