Customize Debug implementation of absolute::LockTime
This commit is contained in:
parent
bbe4800607
commit
71a5fe2b54
|
@ -67,7 +67,7 @@ pub const LOCK_TIME_THRESHOLD: u32 = 500_000_000;
|
|||
/// };
|
||||
/// ```
|
||||
#[allow(clippy::derive_ord_xor_partial_ord)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum LockTime {
|
||||
/// A block height lock time value.
|
||||
///
|
||||
|
@ -294,6 +294,17 @@ impl PartialOrd for LockTime {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for LockTime {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
use LockTime::*;
|
||||
|
||||
match *self {
|
||||
Blocks(ref h) => write!(f, "{} blocks", h),
|
||||
Seconds(ref t) => write!(f, "{} seconds", t),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for LockTime {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
use LockTime::*;
|
||||
|
|
Loading…
Reference in New Issue