From ed57b30d5d628e5cc2e3d83555a75d63b7b030a1 Mon Sep 17 00:00:00 2001 From: timofey Date: Sun, 9 Jul 2023 15:51:59 +0000 Subject: [PATCH] remove trailing punctuation in errors --- src/flow/binary.rs | 4 ++-- src/flow/binary/balancing.rs | 8 ++++---- src/mrds/trees/heighted.rs | 4 ++-- src/rcore/inlining.rs | 2 +- src/rstd/atomic/array.rs | 4 ++-- src/rstd/atomic/au64.rs | 4 ++-- src/rstd/atomic/boolean.rs | 6 +++--- src/rstd/inlining.rs | 2 +- src/rstd/point.rs | 2 +- src/rstd/singular.rs | 2 +- src/testing.rs | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/flow/binary.rs b/src/flow/binary.rs index b80284e..cfe10fc 100644 --- a/src/flow/binary.rs +++ b/src/flow/binary.rs @@ -143,9 +143,9 @@ pub enum HeightError { impl Display for HeightError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::NodeHeight => write!(f, "invalid node height: 0."), + Self::NodeHeight => write!(f, "invalid node height: 0"), Self::LeafHeight(height) => { - write!(f, "invalid leaf height: {height}!=0.") + write!(f, "invalid leaf height: {height}!=0") } } } diff --git a/src/flow/binary/balancing.rs b/src/flow/binary/balancing.rs index ecdf3ed..4f59ca5 100644 --- a/src/flow/binary/balancing.rs +++ b/src/flow/binary/balancing.rs @@ -48,11 +48,11 @@ pub enum BalancingError { impl Display for BalancingError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::Height(height_error) => write!(f, "invalid height: {height_error}."), - Self::Balance(hl, hr) => write!(f, "unbalanced node: {hl} {hr}."), - Self::HeightOverflow => write!(f, "tree height overflow."), + Self::Height(height_error) => write!(f, "invalid height: {height_error}"), + Self::Balance(hl, hr) => write!(f, "unbalanced node: {hl} {hr}"), + Self::HeightOverflow => write!(f, "tree height overflow"), Self::HeightMismatch { children, parent } => { - write!(f, "child-parent height mismatch: {children:?}, {parent}.") + write!(f, "child-parent height mismatch: {children:?}, {parent}") } } } diff --git a/src/mrds/trees/heighted.rs b/src/mrds/trees/heighted.rs index 159a773..68dc056 100644 --- a/src/mrds/trees/heighted.rs +++ b/src/mrds/trees/heighted.rs @@ -163,7 +163,7 @@ impl<'a, A: 'a + Ord + Clone> BinaryTreesUnbalanced<'a> for Trees { } fn balancing_error(&self, _error: BalancingError) -> BTWrap<'a, Self, T> { - panic!("balancing error.") + panic!("balancing error") } fn node_heights(&self, node: &Self::Node) -> (u64, u64) { @@ -173,7 +173,7 @@ impl<'a, A: 'a + Ord + Clone> BinaryTreesUnbalanced<'a> for Trees { impl<'a, A: 'a + Ord + Clone> BinaryTreesBindable<'a> for Trees { fn bounds_error(&self, _error: bounds::BoundsError) -> BTWrap<'a, Self, T> { - panic!("bounds violated."); + panic!("bounds violated"); } } diff --git a/src/rcore/inlining.rs b/src/rcore/inlining.rs index d2c79ca..54d0dbb 100644 --- a/src/rcore/inlining.rs +++ b/src/rcore/inlining.rs @@ -27,7 +27,7 @@ pub trait InliningExt: Inlining { ) -> Result<([u8; N], Self), E> { self.iread_n( N, - |slice| slice.try_into().expect("`iread_n` wrong length."), + |slice| slice.try_into().expect("`iread_n` wrong length"), err, ) } diff --git a/src/rstd/atomic/array.rs b/src/rstd/atomic/array.rs index 6cee1a0..8251913 100644 --- a/src/rstd/atomic/array.rs +++ b/src/rstd/atomic/array.rs @@ -17,10 +17,10 @@ pub enum ArrayParseError { impl Display for ArrayParseError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::Eof => write!(f, "encountered EOF write parsing an array."), + Self::Eof => write!(f, "encountered EOF write parsing an array"), Self::ExtraData(length) => write!( f, - "encountered extra data of length {length} while parsing an array.", + "encountered extra data of length {length} while parsing an array", ), } } diff --git a/src/rstd/atomic/au64.rs b/src/rstd/atomic/au64.rs index f6f49c9..6ec40ee 100644 --- a/src/rstd/atomic/au64.rs +++ b/src/rstd/atomic/au64.rs @@ -17,10 +17,10 @@ pub enum IntParseError { impl Display for IntParseError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::Eof => write!(f, "encountered EOF write parsing an integer."), + Self::Eof => write!(f, "encountered EOF write parsing an integer"), Self::ExtraData(length) => write!( f, - "encountered extra data of length {length} while parsing an integer.", + "encountered extra data of length {length} while parsing an integer", ), } } diff --git a/src/rstd/atomic/boolean.rs b/src/rstd/atomic/boolean.rs index 5e15136..a694af9 100644 --- a/src/rstd/atomic/boolean.rs +++ b/src/rstd/atomic/boolean.rs @@ -22,12 +22,12 @@ impl Display for BooleanParseError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::OutOfBounds(value) => { - write!(f, "boolean value out of bounds: {}.", value) + write!(f, "boolean value out of bounds: {}", value) } - Self::Eof => write!(f, "encountered EOF write parsing a boolean."), + Self::Eof => write!(f, "encountered EOF write parsing a boolean"), Self::ExtraData(length) => write!( f, - "encountered extra data of length {length} while parsing a boolean.", + "encountered extra data of length {length} while parsing a boolean", ), } } diff --git a/src/rstd/inlining.rs b/src/rstd/inlining.rs index 2e95787..168c426 100644 --- a/src/rstd/inlining.rs +++ b/src/rstd/inlining.rs @@ -118,7 +118,7 @@ impl Display for SizeError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, - "expected {} bytes, read/wrote {} instead.", + "expected {} bytes, read/wrote {} instead", self.expected, self.received ) } diff --git a/src/rstd/point.rs b/src/rstd/point.rs index ad958ab..f5c731b 100644 --- a/src/rstd/point.rs +++ b/src/rstd/point.rs @@ -48,7 +48,7 @@ impl Display for PointParseError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::WrongLength(length) => { - write!(f, "expected {} bytes, received {}.", HASH_SIZE, length) + write!(f, "expected {} bytes, received {}", HASH_SIZE, length) } } } diff --git a/src/rstd/singular.rs b/src/rstd/singular.rs index 83e4924..42e5367 100644 --- a/src/rstd/singular.rs +++ b/src/rstd/singular.rs @@ -35,7 +35,7 @@ impl<'a, Ctx: Context<'a>> Resolver<'a, Ctx> for SingularResolver<'a, Ctx> { fn resolve(self: Rc, address: Address) -> HashResolution<'a, Ctx> { let point = self.points.get(address.index).unwrap_or_else(|| { panic!( - "singularity out-of-bounds: {}/{}.", + "singularity out-of-bounds: {}/{}", address.index, self.points.len() ) diff --git a/src/testing.rs b/src/testing.rs index 6bb0e1d..ecdf930 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -56,7 +56,7 @@ impl<'a> Display for TestLookupError<'a> { write!(f, "cast failure: {}", cast_error) } Self::EmptyResolverAccess(address) => { - write!(f, "accessed an empty resolved at address {}.", address) + write!(f, "accessed an empty resolved at address {}", address) } } }