-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuf_read.expanded.rs
48 lines (48 loc) · 1.29 KB
/
buf_read.expanded.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use io_enum::*;
enum Enum<A, B> {
A(A),
B(B),
}
#[automatically_derived]
impl<A, B> ::std::io::BufRead for Enum<A, B>
where
A: ::std::io::BufRead,
B: ::std::io::BufRead,
{
#[inline]
fn fill_buf(&mut self) -> ::std::io::Result<&[u8]> {
match self {
Enum::A(x) => <A as ::std::io::BufRead>::fill_buf(x),
Enum::B(x) => <B as ::std::io::BufRead>::fill_buf(x),
}
}
#[inline]
fn consume(&mut self, amt: usize) {
match self {
Enum::A(x) => <A as ::std::io::BufRead>::consume(x, amt),
Enum::B(x) => <B as ::std::io::BufRead>::consume(x, amt),
}
}
#[inline]
fn read_until(
&mut self,
byte: u8,
buf: &mut ::std::vec::Vec<u8>,
) -> ::std::io::Result<usize> {
match self {
Enum::A(x) => <A as ::std::io::BufRead>::read_until(x, byte, buf),
Enum::B(x) => <B as ::std::io::BufRead>::read_until(x, byte, buf),
}
}
#[inline]
fn read_line(
&mut self,
buf: &mut ::std::string::String,
) -> ::std::io::Result<usize> {
match self {
Enum::A(x) => <A as ::std::io::BufRead>::read_line(x, buf),
Enum::B(x) => <B as ::std::io::BufRead>::read_line(x, buf),
}
}
}
fn main() {}