Update to Rust 2018

This commit is contained in:
sharkdp committed 2019-04-13 18:27:21 +02:00
1 parent 6978f7a277
commit 3390bedee9
4 files changed
+12 -11

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ matrix:
# Minimum Rust supported channel. # Minimum Rust supported channel.
- os: linux - os: linux
rust: 1.30.0 rust: 1.31.0
env: TARGET=x86_64-unknown-linux-gnu env: TARGET=x86_64-unknown-linux-gnu
+1
View File
@@ -8,6 +8,7 @@ name = "hexyl"
readme = "README.md" readme = "README.md"
repository = "https://github.com/sharkdp/hexyl" repository = "https://github.com/sharkdp/hexyl"
version = "0.4.0" version = "0.4.0"
edition = "2018"
[dependencies] [dependencies]
ansi_term = "0.11" ansi_term = "0.11"
+1 -1
View File
@@ -63,7 +63,7 @@ you use a terminal that supports ANSI escape sequences (like PowerShell on Windo
### Via cargo ### Via cargo
If you have Rust 1.30 or higher, you can install `hexyl` from source via `cargo`: If you have Rust 1.31 or higher, you can install `hexyl` from source via `cargo`:
``` ```
cargo install hexyl cargo install hexyl
``` ```
+9 -9
View File
@@ -1,8 +1,8 @@
#[macro_use] #[macro_use]
extern crate clap; extern crate clap;
extern crate ansi_term;
extern crate atty; use atty;
extern crate ctrlc; use ctrlc;
mod squeezer; mod squeezer;
@@ -17,7 +17,7 @@ use ansi_term::Color;
use ansi_term::Color::Fixed; use ansi_term::Color::Fixed;
use atty::Stream; use atty::Stream;
use squeezer::{SqueezeAction, Squeezer}; use crate::squeezer::{SqueezeAction, Squeezer};
const BUFFER_SIZE: usize = 256; const BUFFER_SIZE: usize = 256;
@@ -58,7 +58,7 @@ impl Byte {
} }
fn color(self) -> &'static Color { fn color(self) -> &'static Color {
use ByteCategory::*; use crate::ByteCategory::*;
match self.category() { match self.category() {
Null => &COLOR_NULL, Null => &COLOR_NULL,
@@ -70,7 +70,7 @@ impl Byte {
} }
fn as_char(self) -> char { fn as_char(self) -> char {
use ByteCategory::*; use crate::ByteCategory::*;
match self.category() { match self.category() {
Null => '0', Null => '0',
@@ -167,11 +167,11 @@ struct Printer<'a> {
impl<'a> Printer<'a> { impl<'a> Printer<'a> {
fn new( fn new(
stdout: StdoutLock, stdout: StdoutLock<'_>,
show_color: bool, show_color: bool,
border_style: BorderStyle, border_style: BorderStyle,
use_squeeze: bool, use_squeeze: bool,
) -> Printer { ) -> Printer<'_> {
Printer { Printer {
idx: 1, idx: 1,
raw_line: vec![], raw_line: vec![],
@@ -394,7 +394,7 @@ impl<'a> Printer<'a> {
} }
} }
fn run() -> Result<(), Box<::std::error::Error>> { fn run() -> Result<(), Box<dyn std::error::Error>> {
let app = App::new(crate_name!()) let app = App::new(crate_name!())
.setting(AppSettings::ColorAuto) .setting(AppSettings::ColorAuto)
.setting(AppSettings::ColoredHelp) .setting(AppSettings::ColoredHelp)