Add `Display` impl for `ReceivedNoteId`

This commit is contained in:
Kris Nuttycombe 2023-08-07 12:24:05 -06:00
parent f6eef20f62
commit 1c4e63718f
1 changed files with 9 additions and 1 deletions

View File

@ -38,7 +38,7 @@ use maybe_rayon::{
};
use rusqlite::{self, Connection};
use secrecy::{ExposeSecret, SecretVec};
use std::{borrow::Borrow, collections::HashMap, convert::AsRef, ops::Range, path::Path};
use std::{borrow::Borrow, collections::HashMap, convert::AsRef, fmt, ops::Range, path::Path};
use incrementalmerkletree::Position;
use shardtree::{error::ShardTreeError, ShardTree};
@ -101,6 +101,14 @@ pub(crate) const SAPLING_TABLES_PREFIX: &str = "sapling";
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct ReceivedNoteId(pub(crate) i64);
impl fmt::Display for ReceivedNoteId {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
ReceivedNoteId(id) => write!(f, "Received Note {}", id),
}
}
}
/// A newtype wrapper for sqlite primary key values for the utxos
/// table.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]