Make struct titles consistent

Structs had various phrasings of titles.

Make the wording consistent by concisely stating what it is, instead of
what it does.

Make the wording of all error structs consistent.
This commit is contained in:
Jamil Lambert, PhD 2025-04-14 15:43:57 +01:00 committed by Jamil Lambert
parent afe9ddd5e6
commit 913360b112
No known key found for this signature in database
GPG Key ID: 7F574053F8F17A64
6 changed files with 7 additions and 7 deletions

View File

@ -10,7 +10,7 @@ use internals::write_err;
use super::INPUT_STRING_LEN_LIMIT;
/// An error during amount parsing amount with denomination.
/// Error returned when parsing an amount with denomination fails.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ParseError(pub(crate) ParseErrorInner);
@ -84,7 +84,7 @@ impl std::error::Error for ParseError {
}
}
/// An error during amount parsing.
/// Error returned when parsing an amount fails.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ParseAmountError(pub(crate) ParseAmountErrorInner);

View File

@ -10,7 +10,7 @@ use core::{fmt, ops};
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
/// Represents fee rate.
/// Fee rate.
///
/// This is an integer newtype representing fee rate in `sat/kwu`. It provides protection against
/// mixing up the types as well as basic formatting features.

View File

@ -256,7 +256,7 @@ pub const fn is_block_height(n: u32) -> bool { n < LOCK_TIME_THRESHOLD }
/// Returns true if `n` is a UNIX timestamp i.e., greater than or equal to 500,000,000.
pub const fn is_block_time(n: u32) -> bool { n >= LOCK_TIME_THRESHOLD }
/// An error that occurs when converting a `u32` to a lock time variant.
/// Error returned when converting a `u32` to a lock time variant fails.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct ConversionError {

View File

@ -128,7 +128,7 @@ impl fmt::Display for Time {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Display::fmt(&self.0, f) }
}
/// Input time in seconds was too large to be encoded to a 16 bit 512 second interval.
/// Error returned when the input time in seconds was too large to be encoded to a 16 bit 512 second interval.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TimeOverflowError {
/// Time value in seconds that overflowed.

View File

@ -127,7 +127,7 @@ macro_rules! impl_opt_ext {
}
impl_opt_ext!(Amount, SignedAmount, u64, i64, FeeRate, Weight);
/// An error occurred while doing a mathematical operation.
/// Error returned when a mathematical operation fails.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct NumOpError(MathOp);

View File

@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
/// The factor that non-witness serialization data is multiplied by during weight calculation.
pub const WITNESS_SCALE_FACTOR: usize = 4;
/// Represents weight - the weight of a transaction or block.
/// The weight of a transaction or block.
///
/// This is an integer newtype representing [`Weight`] in `wu`. It provides protection against mixing
/// up types as well as basic formatting features.