Skip to content

Commit dba9d18

Browse files
committed
upgrade error-chain and make backtrace a feature
request: #8
1 parent 31e1b71 commit dba9d18

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Cargo.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntp"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
authors = ["Jeff Belgum <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "Library for parsing and communicating over Network Time Protocol."
@@ -11,10 +11,18 @@ readme = "README.md"
1111
keywords = ["protocol", "network", "time", "parser", "binary"]
1212
categories = ["date-and-time", "network-programming", "parser-implementations", "encoding"]
1313

14+
15+
[features]
16+
backtrace = ["error-chain/backtrace"]
17+
18+
1419
[dependencies]
1520
byteorder = "0.5.3"
1621
conv = "0.3.2"
1722
custom_derive = "0.1.5"
18-
error-chain = "0.5.0"
1923
log = "0.3.6"
2024
time = "0.1.35"
25+
26+
[dependencies.error-chain]
27+
version = "0.10.0"
28+
default-features = false

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Add this to your `Cargo.toml`:
1111

1212
```ini
1313
[dependencies]
14-
ntp = "0.2.0"
14+
ntp = "0.3.0"
1515
```
1616

1717
and this to your crate root:
@@ -40,4 +40,4 @@ License
4040

4141
`ntplib` is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
4242

43-
See LICENSE-APACHE, and LICENSE-MIT for details.
43+
See LICENSE-APACHE and LICENSE-MIT for details.

src/errors.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
use std::io;
22
use conv::Unrepresentable;
33

4-
// TODO use newer syntax for foreign_links section
5-
// generate error types for this crate using https://github.com/brson/error-chain
64
error_chain! {
75
foreign_links {
8-
io::Error, IOError;
9-
Unrepresentable<u8>, UnrepresentableU8;
10-
Unrepresentable<u32>, UnrepresentableU32;
6+
IOError(io::Error);
7+
UnrepresentableU8(Unrepresentable<u8>);
8+
UnrepresentableU32(Unrepresentable<u32>);
119
}
1210
}

0 commit comments

Comments
 (0)