Conversation
| use std::env; | ||
| use std::fs; | ||
| #![feature(seek_stream_len)] | ||
| #![warn(clippy::pedantic)] |
There was a problem hiding this comment.
this enables pedantic lints when you run cargo clippy. It's not a bad way to learn Rust idioms (but as the name suggests, it can be quite pedantic!)
| use std::fs; | ||
| #![feature(seek_stream_len)] | ||
| #![warn(clippy::pedantic)] | ||
| #![deny(missing_docs, missing_debug_implementations, clippy::all)] |
There was a problem hiding this comment.
these are more compiler flags. You may not want these, but there are loads more of this too if you want to enforce certain idioms in your codebase. these are some of my favourites
deny(missing_docs)- this will prevent your code from compiling if you have failed to document anything which is in your public APIdeny(missing_debug_implementations)- prevent code from compiling if any struct is missing aDebugimplementation (this prevents errors involving this type being printed nicely to console)deny(clippy::all)- prevent compiling for any standard clippy lint. all the lints in this category are very sensible, so this is a good one to enforce
|
the iterator i've sketched here means you can operate without pulling the whole file into memory at once, but if you don't mind reading the whole file into memory you use either of the following to get 1024 byte chunks
depends on how big the files are, and how much you care about memory usage. (I would use the streaming iterator, feels a bit more 'Rusty') |
|
I adopted most of these, but have issues with the missing docs one, cannot find a good way to use it. See commit above Also, running Any ideas? |
This lint is complaining that you don't have top-level documentation. to comment a scope in rust you use a triple slash ( so if you add documentation comments to the top of the
i'll rebase this pull request and silence those lints |
|
couple more tips- structopt is way better than clap. It's a wrapper around clap that takes the calp 'stringly-typed' interface and gives you a strongly-typed struct. It's so much better than Clap in fact that Clap 3.0 pulls structopt into the the clap repo itself and exports it as it's main interface. that version of clap is in beta, but it's pretty stable. the |
|
ok the rebase was painful. see #2 instead |
Inspired by / stolen from PR #1 Not called ChunkIterator because a more specific "chunk iterator" will be created next for converting text into chunk string content (base64 incl. prefix)
Inspired by / stolen from PR #1 Not called ChunkIterator because a more specific "chunk iterator" will be created next for converting text into chunk string content (base64 incl. prefix)
No description provided.