Run cargo fmt on the whole code base (#9394)

* Run cargo fmt on the whole code base

* Second run

* Add CI check

* Fix compilation

* More unnecessary braces

* Handle weights

* Use --all

* Use correct attributes...

* Fix UI tests

* AHHHHHHHHH

* 🤦

* Docs

* Fix compilation

* 🤷

* Please stop

* 🤦 x 2

* More

* make rustfmt.toml consistent with polkadot

Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
Bastian Köcher
2021-07-21 16:32:32 +02:00
committed by GitHub
parent d451c38c1c
commit 7b56ab15b4
1010 changed files with 53339 additions and 51208 deletions
@@ -18,8 +18,7 @@
//! Handling of blobs that may be compressed, based on an 8-byte magic identifier
//! at the head.
use std::borrow::Cow;
use std::io::Read;
use std::{borrow::Cow, io::Read};
// An arbitrary prefix, that indicates a blob beginning with should be decompressed with
// Zstd compression.
@@ -52,7 +51,7 @@ impl std::fmt::Display for Error {
}
}
impl std::error::Error for Error { }
impl std::error::Error for Error {}
fn read_from_decoder(
decoder: impl Read,
@@ -81,8 +80,8 @@ fn decompress_zstd(blob: &[u8], bomb_limit: usize) -> Result<Vec<u8>, Error> {
#[cfg(target_os = "unknown")]
fn decompress_zstd(mut blob: &[u8], bomb_limit: usize) -> Result<Vec<u8>, Error> {
let blob_len = blob.len();
let decoder = ruzstd::streaming_decoder::StreamingDecoder::new(&mut blob)
.map_err(|_| Error::Invalid)?;
let decoder =
ruzstd::streaming_decoder::StreamingDecoder::new(&mut blob).map_err(|_| Error::Invalid)?;
read_from_decoder(decoder, blob_len, bomb_limit)
}
@@ -105,7 +104,7 @@ pub fn compress(blob: &[u8], bomb_limit: usize) -> Option<Vec<u8>> {
use std::io::Write;
if blob.len() > bomb_limit {
return None;
return None
}
let mut buf = ZSTD_PREFIX.to_vec();