mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:34 +00:00
Update to Rust 2018
This commit is contained in:
1 parent
6978f7a277
commit
3390bedee9
4 files changed
+12
-11
No files matched your search
+1
-1
@@ -18,7 +18,7 @@ matrix:
|
||||
|
||||
# Minimum Rust supported channel.
|
||||
- os: linux
|
||||
rust: 1.30.0
|
||||
rust: 1.31.0
|
||||
env: TARGET=x86_64-unknown-linux-gnu
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ name = "hexyl"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/sharkdp/hexyl"
|
||||
version = "0.4.0"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
ansi_term = "0.11"
|
||||
|
||||
@@ -63,7 +63,7 @@ you use a terminal that supports ANSI escape sequences (like PowerShell on Windo
|
||||
|
||||
### 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
|
||||
```
|
||||
|
||||
+9
-9
@@ -1,8 +1,8 @@
|
||||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate ansi_term;
|
||||
extern crate atty;
|
||||
extern crate ctrlc;
|
||||
|
||||
use atty;
|
||||
use ctrlc;
|
||||
|
||||
mod squeezer;
|
||||
|
||||
@@ -17,7 +17,7 @@ use ansi_term::Color;
|
||||
use ansi_term::Color::Fixed;
|
||||
|
||||
use atty::Stream;
|
||||
use squeezer::{SqueezeAction, Squeezer};
|
||||
use crate::squeezer::{SqueezeAction, Squeezer};
|
||||
|
||||
const BUFFER_SIZE: usize = 256;
|
||||
|
||||
@@ -58,7 +58,7 @@ impl Byte {
|
||||
}
|
||||
|
||||
fn color(self) -> &'static Color {
|
||||
use ByteCategory::*;
|
||||
use crate::ByteCategory::*;
|
||||
|
||||
match self.category() {
|
||||
Null => &COLOR_NULL,
|
||||
@@ -70,7 +70,7 @@ impl Byte {
|
||||
}
|
||||
|
||||
fn as_char(self) -> char {
|
||||
use ByteCategory::*;
|
||||
use crate::ByteCategory::*;
|
||||
|
||||
match self.category() {
|
||||
Null => '0',
|
||||
@@ -167,11 +167,11 @@ struct Printer<'a> {
|
||||
|
||||
impl<'a> Printer<'a> {
|
||||
fn new(
|
||||
stdout: StdoutLock,
|
||||
stdout: StdoutLock<'_>,
|
||||
show_color: bool,
|
||||
border_style: BorderStyle,
|
||||
use_squeeze: bool,
|
||||
) -> Printer {
|
||||
) -> Printer<'_> {
|
||||
Printer {
|
||||
idx: 1,
|
||||
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!())
|
||||
.setting(AppSettings::ColorAuto)
|
||||
.setting(AppSettings::ColoredHelp)
|
||||
|
||||
Reference in new issue
Block a user