Skip to content

Commit

Permalink
set the edition to 2021
Browse files Browse the repository at this point in the history
and some import changes that are required for that edition
  • Loading branch information
folkertdev committed Dec 9, 2024
1 parent b397f2a commit f7fe17c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
edition = "2021"
name = "bzip2"
version = "0.4.4"
authors = ["Alex Crichton <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion src/bufread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::io;
use std::io::prelude::*;

use {Action, Compress, Compression, Decompress, Status};
use crate::{Action, Compress, Compression, Decompress, Status};

/// A bz2 encoder, or compressor.
///
Expand Down
2 changes: 1 addition & 1 deletion src/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::slice;

use libc::{c_int, c_uint};

use {ffi, Compression};
use crate::{ffi, Compression};

/// Representation of an in-memory compression stream.
///
Expand Down
10 changes: 5 additions & 5 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use std::io::prelude::*;
use std::io::{self, BufReader};

use bufread;
use Compression;
use crate::bufread;
use crate::Compression;

/// A compression stream which wraps an uncompressed stream of data. Compressed
/// data will be read from the stream.
Expand Down Expand Up @@ -188,13 +188,13 @@ impl<R: Read> Read for MultiBzDecoder<R> {

#[cfg(test)]
mod tests {
use crate::read::{BzDecoder, BzEncoder, MultiBzDecoder};
use crate::Compression;
use partial_io::quickcheck_types::{GenInterrupted, PartialWithErrors};
use partial_io::PartialRead;
use rand::distributions::Standard;
use rand::{thread_rng, Rng};
use read::{BzDecoder, BzEncoder, MultiBzDecoder};
use std::io::prelude::*;
use Compression;
use std::io::Read;

#[test]
fn smoke() {
Expand Down
11 changes: 6 additions & 5 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::io;
use std::io::prelude::*;

use {Action, Compress, Compression, Decompress, Status};
use crate::{Action, Compress, Compression, Decompress, Status};

/// A compression stream which will have uncompressed data written to it and
/// will write compressed data to an output stream.
Expand Down Expand Up @@ -268,6 +268,7 @@ impl<W: Write> Drop for BzDecoder<W> {
#[cfg(test)]
mod tests {
use super::{BzDecoder, BzEncoder};
use crate::Compression;
use partial_io::quickcheck_types::{GenInterrupted, PartialWithErrors};
use partial_io::PartialWrite;
use std::io::prelude::*;
Expand All @@ -276,7 +277,7 @@ mod tests {
#[test]
fn smoke() {
let d = BzDecoder::new(Vec::new());
let mut c = BzEncoder::new(d, ::Compression::default());
let mut c = BzEncoder::new(d, Compression::default());
c.write_all(b"12834").unwrap();
let s = repeat("12345").take(100000).collect::<String>();
c.write_all(s.as_bytes()).unwrap();
Expand All @@ -289,7 +290,7 @@ mod tests {
#[test]
fn write_empty() {
let d = BzDecoder::new(Vec::new());
let mut c = BzEncoder::new(d, ::Compression::default());
let mut c = BzEncoder::new(d, Compression::default());
c.write(b"").unwrap();
let data = c.finish().unwrap().finish().unwrap();
assert_eq!(&data[..], b"");
Expand All @@ -301,7 +302,7 @@ mod tests {

fn test(v: Vec<u8>) -> bool {
let w = BzDecoder::new(Vec::new());
let mut w = BzEncoder::new(w, ::Compression::default());
let mut w = BzEncoder::new(w, Compression::default());
w.write_all(&v).unwrap();
v == w.finish().unwrap().finish().unwrap()
}
Expand All @@ -317,7 +318,7 @@ mod tests {
decode_ops: PartialWithErrors<GenInterrupted>,
) -> bool {
let w = BzDecoder::new(PartialWrite::new(Vec::new(), decode_ops));
let mut w = BzEncoder::new(PartialWrite::new(w, encode_ops), ::Compression::default());
let mut w = BzEncoder::new(PartialWrite::new(w, encode_ops), Compression::default());
w.write_all(&v).unwrap();
v == w
.finish()
Expand Down

0 comments on commit f7fe17c

Please sign in to comment.