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
27 lines (25 loc) · 637 Bytes
/
Copy pathmacros.rs
File metadata and controls
27 lines (25 loc) · 637 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
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()));
})
}