forked from rust-postgres/rust-postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacros.rs
More file actions
37 lines (33 loc) · 790 Bytes
/
Copy pathmacros.rs
File metadata and controls
37 lines (33 loc) · 790 Bytes
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
macro_rules! try_desync {
($s:expr, $e:expr) => (
match $e {
Ok(ok) => ok,
Err(err) => {
$s.desynchronized = true;
return Err(::std::convert::From::from(err));
}
}
)
}
macro_rules! check_desync {
($e:expr) => ({
if $e.is_desynchronized() {
return Err(::error::Error::Io(::desynchronized()));
}
})
}
macro_rules! bad_response {
($s:expr) => ({
debug!("Bad response at {}:{}", file!(), line!());
$s.desynchronized = true;
return Err(::error::Error::Io(::bad_response()));
})
}
#[cfg(feature = "no-logging")]
macro_rules! debug {
($($t:tt)*) => {}
}
#[cfg(feature = "no-logging")]
macro_rules! info {
($($t:tt)*) => {}
}