summaryrefslogtreecommitdiff
path: root/src/rust/protover/errors.rs
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2018-08-03 19:48:10 +0000
committerNick Mathewson <nickm@torproject.org>2018-08-16 08:42:57 -0400
commit6b609ce4356423a28e7b421a9f09849d831a0c6f (patch)
tree0feff6aae6ea11f4933d47e96949539c32368e3d /src/rust/protover/errors.rs
parent32ad8e991999277948e896196731f2919c390f00 (diff)
downloadtor-6b609ce4356423a28e7b421a9f09849d831a0c6f.tar.gz
tor-6b609ce4356423a28e7b421a9f09849d831a0c6f.zip
rust: run rustfmt
Diffstat (limited to 'src/rust/protover/errors.rs')
-rw-r--r--src/rust/protover/errors.rs38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/rust/protover/errors.rs b/src/rust/protover/errors.rs
index 56473d12e6..71fbc53e17 100644
--- a/src/rust/protover/errors.rs
+++ b/src/rust/protover/errors.rs
@@ -24,20 +24,30 @@ pub enum ProtoverError {
impl Display for ProtoverError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
- ProtoverError::Overlap
- => write!(f, "Two or more (low, high) protover ranges would overlap once expanded."),
- ProtoverError::LowGreaterThanHigh
- => write!(f, "The low in a (low, high) protover range was greater than high."),
- ProtoverError::Unparseable
- => write!(f, "The protover string was unparseable."),
- ProtoverError::ExceedsMax
- => write!(f, "The high in a (low, high) protover range exceeds u32::MAX."),
- ProtoverError::ExceedsExpansionLimit
- => write!(f, "The protover string would exceed the maximum expansion limit."),
- ProtoverError::UnknownProtocol
- => write!(f, "A protocol in the protover string we attempted to parse is unknown."),
- ProtoverError::ExceedsNameLimit
- => write!(f, "An unrecognised protocol name was too long."),
+ ProtoverError::Overlap => write!(
+ f,
+ "Two or more (low, high) protover ranges would overlap once expanded."
+ ),
+ ProtoverError::LowGreaterThanHigh => write!(
+ f,
+ "The low in a (low, high) protover range was greater than high."
+ ),
+ ProtoverError::Unparseable => write!(f, "The protover string was unparseable."),
+ ProtoverError::ExceedsMax => write!(
+ f,
+ "The high in a (low, high) protover range exceeds u32::MAX."
+ ),
+ ProtoverError::ExceedsExpansionLimit => write!(
+ f,
+ "The protover string would exceed the maximum expansion limit."
+ ),
+ ProtoverError::UnknownProtocol => write!(
+ f,
+ "A protocol in the protover string we attempted to parse is unknown."
+ ),
+ ProtoverError::ExceedsNameLimit => {
+ write!(f, "An unrecognised protocol name was too long.")
+ }
}
}
}