Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Dec 18, 2018
1 parent 9d8ccf1 commit 4569bd8
Show file tree
Hide file tree
Showing 41 changed files with 141 additions and 132 deletions.
8 changes: 4 additions & 4 deletions examples/deflatedecoder-bufread.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::DeflateEncoder;
use flate2::bufread::DeflateDecoder;
use flate2::write::DeflateEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/deflatedecoder-read.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::DeflateEncoder;
use flate2::read::DeflateDecoder;
use flate2::write::DeflateEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/deflatedecoder-write.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::DeflateEncoder;
use flate2::write::DeflateDecoder;
use flate2::write::DeflateEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
6 changes: 3 additions & 3 deletions examples/deflateencoder-bufread.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::bufread::DeflateEncoder;
use flate2::Compression;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::io::BufReader;

// Open file and debug print the contents compressed with Deflate
Expand Down
6 changes: 3 additions & 3 deletions examples/deflateencoder-read.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::read::DeflateEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Print the Deflate compressed representation of hello world
fn main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/deflateencoder-write.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
extern crate flate2;

use std::io::prelude::*;
use flate2::Compression;
use flate2::write::DeflateEncoder;
use flate2::Compression;
use std::io::prelude::*;

// Vec<u8> implements Write to print the compressed bytes of sample string
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/gzbuilder.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use std::fs::File;
use flate2::GzBuilder;
use flate2::Compression;
use flate2::GzBuilder;
use std::fs::File;
use std::io;
use std::io::prelude::*;

// Open file and debug print the contents compressed with gzip
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/gzdecoder-bufread.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::GzEncoder;
use flate2::bufread::GzDecoder;
use flate2::write::GzEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/gzdecoder-read.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::GzEncoder;
use flate2::read::GzDecoder;
use flate2::write::GzEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
6 changes: 3 additions & 3 deletions examples/gzdecoder-write.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::write::{GzDecoder, GzEncoder};
use flate2::Compression;
use flate2::write::{GzEncoder, GzDecoder};
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
6 changes: 3 additions & 3 deletions examples/gzencoder-bufread.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::bufread::GzEncoder;
use flate2::Compression;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::io::BufReader;

// Open file and debug print the contents compressed with gzip
Expand Down
6 changes: 3 additions & 3 deletions examples/gzencoder-read.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::read::GzEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Print the GZ compressed representation of hello world
fn main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/gzencoder-write.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
extern crate flate2;

use std::io::prelude::*;
use flate2::Compression;
use flate2::write::GzEncoder;
use flate2::Compression;
use std::io::prelude::*;

// Vec<u8> implements Write to print the compressed bytes of sample string
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/gzmultidecoder-bufread.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::GzEncoder;
use flate2::bufread::MultiGzDecoder;
use flate2::write::GzEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/gzmultidecoder-read.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::GzEncoder;
use flate2::read::MultiGzDecoder;
use flate2::write::GzEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/zlibdecoder-bufread.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::ZlibEncoder;
use flate2::bufread::ZlibDecoder;
use flate2::write::ZlibEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/zlibdecoder-read.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::ZlibEncoder;
use flate2::read::ZlibDecoder;
use flate2::write::ZlibEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
8 changes: 4 additions & 4 deletions examples/zlibdecoder-write.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::write::ZlibEncoder;
use flate2::write::ZlibDecoder;
use flate2::write::ZlibEncoder;
use flate2::Compression;
use std::io;
use std::io::prelude::*;

// Compress a sample string and print it after transformation.
fn main() {
Expand Down
6 changes: 3 additions & 3 deletions examples/zlibencoder-bufread.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate flate2;

use std::io::prelude::*;
use std::io;
use flate2::Compression;
use flate2::bufread::ZlibEncoder;
use flate2::Compression;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::io::BufReader;

// Open file and debug print the contents compressed with zlib
Expand Down
4 changes: 2 additions & 2 deletions examples/zlibencoder-read.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate flate2;

use std::io::prelude::*;
use flate2::Compression;
use flate2::read::ZlibEncoder;
use flate2::Compression;
use std::fs::File;
use std::io::prelude::*;

// Open file and debug print the compressed contents
fn main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/zlibencoder-write.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
extern crate flate2;

use std::io::prelude::*;
use flate2::Compression;
use flate2::write::ZlibEncoder;
use flate2::Compression;
use std::io::prelude::*;

// Vec<u8> implements Write to print the compressed bytes of sample string
fn main() {
Expand Down
5 changes: 3 additions & 2 deletions miniz-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ use std::env;
fn main() {
let target = env::var("TARGET").unwrap();
if target == "wasm32-unknown-unknown" {
return
return;
}
let mut build = cc::Build::new();
build.file("miniz.c")
build
.file("miniz.c")
.define("MINIZ_NO_STDIO", None)
.define("MINIZ_NO_ARCHIVE_APIS", None)
.define("MINIZ_NO_ARCHIVE_WRITING_APIS", None)
Expand Down
7 changes: 5 additions & 2 deletions src/crc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Simple CRC bindings backed by miniz.c
use std::io::prelude::*;
use std::io;
use std::io::prelude::*;

use crc32fast::Hasher;

Expand All @@ -26,7 +26,10 @@ pub struct CrcReader<R> {
impl Crc {
/// Create a new CRC.
pub fn new() -> Crc {
Crc { amt: 0, hasher: Hasher::new() }
Crc {
amt: 0,
hasher: Hasher::new(),
}
}

/// Returns the current crc32 checksum.
Expand Down
2 changes: 1 addition & 1 deletion src/deflate/bufread.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::io::prelude::*;
use std::io;
use std::io::prelude::*;
use std::mem;

#[cfg(feature = "tokio")]
Expand Down
4 changes: 2 additions & 2 deletions src/deflate/read.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::io::prelude::*;
use std::io;
use std::io::prelude::*;

#[cfg(feature = "tokio")]
use futures::Poll;
#[cfg(feature = "tokio")]
use tokio_io::{AsyncRead, AsyncWrite};

use bufreader::BufReader;
use super::bufread;
use bufreader::BufReader;

/// A DEFLATE encoder, or compressor.
///
Expand Down
2 changes: 1 addition & 1 deletion src/deflate/write.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::io::prelude::*;
use std::io;
use std::io::prelude::*;

#[cfg(feature = "tokio")]
use futures::Poll;
Expand Down
Loading

0 comments on commit 4569bd8

Please sign in to comment.