[dependencies]: remove util/macros#11501
Conversation
899403d to
b70b96c
Compare
| // TODO(niklasad1): use expect or unwrap only used for tests?! | ||
| #[doc(hidden)] | ||
| pub fn write_and_flush(s: String) { | ||
| let _ = std::io::Write::write_all(&mut std::io::stdout(), s.as_bytes()); |
There was a problem hiding this comment.
Changed this to write_all instead of write seems better because we are not notified if only a part of the buffer is written, thoughts?
| name = "migration-rocksdb" | ||
| version = "0.1.0" | ||
| authors = ["Parity Technologies <admin@parity.io>"] | ||
| edition = "2018" |
There was a problem hiding this comment.
sorry I couldn't resist, it was such a simple fix.
|
(what's up with the force-push, makes it hard to review additions) |
| start_stop_hook(&name, HookType::OnStart); | ||
|
|
||
| flush!(" - {}...", name); | ||
| println!(" - {}...", name); |
There was a problem hiding this comment.
redundant, let's replace with writeln + flush.
Sorry, my bad it just think is so ugly will |
| } else { | ||
| "".into() | ||
| }; | ||
| let empty_steps = header_empty_steps(header).as_ref().map_or(String::new(), |empty_steps| { |
There was a problem hiding this comment.
this change is also unrelated, I found this piece very hard to read especially the fold
`write` is performed to `stdout` `logging` is performed to `stderr`
| H512::from_low_u64_be(10) => 50 | ||
| ], | ||
| propagated_to: { | ||
| let mut map = BTreeMap::new(); |
There was a problem hiding this comment.
nit, I think I started to investigate if we could get rid of map completely but forgot this.
There was a problem hiding this comment.
I thought you left it on purpose. Why use a macro when it doesn’t save much typing and doesn’t make the code clearer?
There was a problem hiding this comment.
I was just too lazy, my rule of thumb is when we have more than 2-3 items in a BTreeMap then I use btreemap!.
At least after this change we are consistent in the crate but I saw that we can easily remove maplit in the rpc crate
EDIT: when it comes to dev-dependencies I'm more willing to use those macros than in production code
* master: (27 commits) Faster kill_garbage (#11514) [EngineSigner]: don't sign message with only zeroes (#11524) fix compilation warnings (#11522) [ethcore cleanup]: various unrelated fixes from `#11493` (#11507) Add benchmark for transaction execution (#11509) Add Smart Contract License v1.0 Misc fixes (#11510) [dependencies]: unify `rustc-hex` (#11506) Activate on-chain randomness in POA Sokol (#11505) Grab bag of cleanup (#11504) Implement eth/64 (EIP-2364) and drop support for eth/62 (#11472) [dependencies]: remove `util/macros` (#11501) OpenEthereum bootnodes are added (#11499) [ci benches]: use `all-features` (#11496) [verification]: make test-build compile standalone (#11495) complete null-signatures removal (#11491) Include the seal when populating the header for a new block (#11475) fix compilation warnings (#11492) cargo update -p cmake (#11490) update to published rlp-derive (#11489) ...
Closing #11478
Nothing very exciting in this PR to summarize:
util/macroscrate, moveflush!andflushln!toethcore/json_tests.macroswithmaplitslice_intoandvec_intoare removedNote, I didn't replace
flush, flushlnwith logging in the json-tests. Let's keep out of this PR