Clean up deprecated and clippy warnings

This commit is contained in:
Dániel Buga
2020-10-05 11:00:07 +02:00
parent 4a09914aa0
commit 71a582b31f
2 changed files with 6 additions and 6 deletions

View File

@@ -169,7 +169,7 @@ named!(
named!( named!(
set_mode<&str, AnsiSequence>, set_mode<&str, AnsiSequence>,
do_parse!( do_parse!(
tag_s!("[=") >> tag!("[=") >>
mode: parse_int >> mode: parse_int >>
conv: expr_res!(mode.try_into()) >> conv: expr_res!(mode.try_into()) >>
tag!("h") >> tag!("h") >>
@@ -180,7 +180,7 @@ named!(
named!( named!(
reset_mode<&str, AnsiSequence>, reset_mode<&str, AnsiSequence>,
do_parse!( do_parse!(
tag_s!("[=") >> tag!("[=") >>
mode: parse_int >> mode: parse_int >>
conv: expr_res!(mode.try_into()) >> conv: expr_res!(mode.try_into()) >>
tag!("l") >> tag!("l") >>
@@ -298,7 +298,7 @@ named!(
named!( named!(
pub parse_escape<&str, Output>, pub parse_escape<&str, Output>,
do_parse!( do_parse!(
tag_s!("\u{1b}") >> tag!("\u{1b}") >>
seq: combined >> seq: combined >>
(Output::Escape(seq)) (Output::Escape(seq))
) )

View File

@@ -2,11 +2,11 @@ use crate::enums::{Output};
use crate::parsers::parse_escape; use crate::parsers::parse_escape;
pub trait AnsiParser { pub trait AnsiParser {
fn ansi_parse<'a>(&'a self) -> AnsiParseIterator<'a>; fn ansi_parse(&self) -> AnsiParseIterator<'_>;
} }
impl AnsiParser for str { impl AnsiParser for str {
fn ansi_parse<'a>(&'a self) -> AnsiParseIterator<'a> { fn ansi_parse(&self) -> AnsiParseIterator<'_> {
AnsiParseIterator { AnsiParseIterator {
dat: self dat: self
} }
@@ -14,7 +14,7 @@ impl AnsiParser for str {
} }
impl AnsiParser for String { impl AnsiParser for String {
fn ansi_parse<'a>(&'a self) -> AnsiParseIterator<'a> { fn ansi_parse(&self) -> AnsiParseIterator<'_> {
AnsiParseIterator { AnsiParseIterator {
dat: self dat: self
} }