From af70970f292a33063d8a8cbc918f12fd70b15f4f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 18 May 2020 21:26:26 +0200 Subject: Make types Debug Signed-off-by: Matthias Beyer --- src/app.rs | 1 + src/repository/client.rs | 9 ++++++++- src/repository/repository.rs | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index cc07c6e..b31839f 100644 --- a/src/app.rs +++ b/src/app.rs @@ -14,6 +14,7 @@ use crate::types::payload::Payload; use crate::types::util::Timestamp; use crate::version::protocol_version; +#[derive(Debug, Clone)] pub struct App { repo: Repository, device_name: IPNSHash, diff --git a/src/repository/client.rs b/src/repository/client.rs index 841625d..f5917d4 100644 --- a/src/repository/client.rs +++ b/src/repository/client.rs @@ -1,6 +1,7 @@ use std::io::Cursor; use std::sync::Arc; use std::ops::Deref; +use std::result::Result as RResult; use ipfs_api::IpfsClient; use anyhow::Error; @@ -30,6 +31,12 @@ use crate::types::util::IPNSHash; #[derive(Clone)] pub struct ClientFassade(Arc); +impl std::fmt::Debug for ClientFassade { + fn fmt(&self, f: &mut std::fmt::Formatter) -> RResult<(), std::fmt::Error> { + write!(f, "ClientFassade") + } +} + impl ClientFassade { fn new(host: &str, port: u16) -> Result { debug!("Creating new ClientFassade object: {}:{}", host, port); @@ -81,7 +88,7 @@ impl ClientFassade { } /// Client wrapper for working with types directly on the client -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct TypedClientFassade(ClientFassade); impl Deref for TypedClientFassade { diff --git a/src/repository/repository.rs b/src/repository/repository.rs index a63c2d6..cc940c6 100644 --- a/src/repository/repository.rs +++ b/src/repository/repository.rs @@ -27,7 +27,7 @@ use crate::repository::client::TypedClientFassade; /// /// Should not be used too extensively, but rather through the "Profile" type, which represents the /// profile of a user. -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct Repository(TypedClientFassade); impl Deref for Repository { -- cgit v1.2.3