Skip to content

Commit

Permalink
Configure formatting style to imports_granularity = "Module".
Browse files Browse the repository at this point in the history
  • Loading branch information
gendx committed Aug 26, 2022
1 parent a24679d commit 2ea7463
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
on: [push, pull_request]
name: Formatting on stable toolchain
name: Formatting on nightly toolchain
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt

Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imports_granularity = "Module"
3 changes: 1 addition & 2 deletions src/decode/lzma.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::decode::lzbuffer::{LzBuffer, LzCircularBuffer};
use crate::decode::rangecoder;
use crate::decode::rangecoder::RangeDecoder;
use crate::decompress::Options;
use crate::decompress::UnpackedSize;
use crate::decompress::{Options, UnpackedSize};
use crate::error;
use byteorder::{LittleEndian, ReadBytesExt};
use std::io;
Expand Down
6 changes: 2 additions & 4 deletions src/decode/lzma2.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::decode::lzbuffer;
use crate::decode::lzbuffer::LzBuffer;
use crate::decode::lzma::DecoderState;
use crate::decode::lzma::LzmaProperties;
use crate::decode::rangecoder;
use crate::decode::lzma::{DecoderState, LzmaProperties};
use crate::decode::{lzbuffer, rangecoder};
use crate::error;
use byteorder::{BigEndian, ReadBytesExt};
use std::io;
Expand Down
3 changes: 1 addition & 2 deletions src/decode/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::hash;
use std::io;
use std::{hash, io};

pub fn read_tag<R: io::BufRead>(input: &mut R, tag: &[u8]) -> io::Result<bool> {
let mut buf = vec![0; tag.len()];
Expand Down
3 changes: 1 addition & 2 deletions src/encode/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::hash;
use std::io;
use std::{hash, io};

// A Write computing a digest on the bytes written.
pub struct HasherWrite<'a, W, H>
Expand Down
3 changes: 1 addition & 2 deletions src/encode/xz.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::decode;
use crate::encode::lzma2;
use crate::encode::util;
use crate::encode::{lzma2, util};
use crate::xz::{footer, header, CheckMethod, StreamFlags};
use byteorder::{LittleEndian, WriteBytesExt};
use crc::{crc32, Hasher32};
Expand Down
3 changes: 1 addition & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! Error handling.

use std::fmt::Display;
use std::io;
use std::result;
use std::{io, result};

/// Library errors.
#[derive(Debug)]
Expand Down

0 comments on commit 2ea7463

Please sign in to comment.