Merge pull request #890 from nuttycom/received_note_id_display

Add `Display` impl for `ReceivedNoteId`
This commit is contained in:
str4d 2023-08-07 20:06:28 +01:00 committed by GitHub
commit 81d1928497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)]