esp8266at: add missing dyn and b""

This commit is contained in:
Wladimir J. van der Laan 2019-12-31 22:45:10 +00:00
parent a1c65405ea
commit a59cbcd4ee
3 changed files with 9 additions and 9 deletions

View File

@ -10,11 +10,11 @@ pub fn mainloop<P, F, X>(
h: &mut SerialNetworkHandler<X>,
port: &mut P,
mut f: F,
debug: &mut fmt::Write,
debug: &mut dyn fmt::Write,
) -> io::Result<()>
where
P: io::Read,
F: FnMut(&mut SerialNetworkHandler<X>, NetworkEvent, &mut fmt::Write) -> bool,
F: FnMut(&mut SerialNetworkHandler<X>, NetworkEvent, &mut dyn fmt::Write) -> bool,
X: io::Write,
{
let mut serial_buf: Vec<u8> = vec![0; 2560]; // 2048 + some

View File

@ -117,8 +117,8 @@ named!(hex_u8<&[u8], u8>,
named!(qstr<&[u8], &[u8]>,
do_parse!(
tag!(b"\"") >>
a: escaped!(is_not!("\\\""), b'\\', one_of!(b"\"\\")) >>
//a: is_not!("\"") >>
a: escaped!(is_not!(b"\\\""), b'\\', one_of!(b"\"\\")) >>
//a: is_not!(b"\"") >>
tag!(b"\"") >>
( a )
)
@ -206,11 +206,11 @@ named!(cmdresponse<&[u8],CmdResponse>,
| do_parse!(
tag!(b"+CWJAP_CUR:") >>
a: qstr >>
tag!(",") >>
tag!(b",") >>
b: qstr >>
tag!(",") >>
tag!(b",") >>
c: num_i32 >>
tag!(",") >>
tag!(b",") >>
d: num_i32 >>
(CmdResponse::CWJAP_CUR(a,b,c,d))
)
@ -253,7 +253,7 @@ named!(cmdresponse<&[u8],CmdResponse>,
named!(cmdecho<&[u8],&[u8]>,
recognize!(tuple!(
tag!(b"AT"),
take_until!("\r")
take_until!("\r") // should be b"\r" but that gives a compiler error
))
);

View File

@ -22,6 +22,6 @@ where
type Error = io::Error;
fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
(self as &mut io::Write).write_all(buf)
(self as &mut dyn io::Write).write_all(buf)
}
}