summaryrefslogtreecommitdiff
path: root/abnf_to_pest
diff options
context:
space:
mode:
authorNadrieril2019-03-09 16:24:14 +0100
committerNadrieril2019-03-09 16:24:14 +0100
commitcb9dfc1b9421e9814dac3ba6c78bad0d271f9d67 (patch)
treefa1b6e14b16c7d63f6ad7df8ed583f24cbdad3c2 /abnf_to_pest
parent6037cb224c5e61828ba41cb3d34438ad03a71403 (diff)
Obey clippy lints
Closes #14
Diffstat (limited to 'abnf_to_pest')
-rw-r--r--abnf_to_pest/src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/abnf_to_pest/src/lib.rs b/abnf_to_pest/src/lib.rs
index 8d858bb..72746c0 100644
--- a/abnf_to_pest/src/lib.rs
+++ b/abnf_to_pest/src/lib.rs
@@ -1,3 +1,4 @@
+#![allow(clippy::implicit_hasher, clippy::or_fun_call)]
use itertools::Itertools;
use std::collections::HashMap;
@@ -16,7 +17,7 @@ impl Default for PestRuleSettings {
}
pub fn abnf_to_pest(
- data: &Vec<u8>,
+ data: &[u8],
rule_settings: &HashMap<String, PestRuleSettings>,
) -> std::io::Result<String> {
use abnf::abnf::*;
@@ -123,7 +124,7 @@ pub fn abnf_to_pest(
}
}
fn format_char(x: u64) -> String {
- if x <= (u8::max_value() as u64) {
+ if x <= u64::from(u8::max_value()) {
let x: u8 = x as u8;
if x.is_ascii_graphic() {
let x: char = x as char;