From a1926e0972522ae1c117c8e31f4082069aae3c3b Mon Sep 17 00:00:00 2001 From: Darius Date: Sun, 3 Dec 2023 12:05:23 -0500 Subject: [PATCH] chore: Remove unused imports --- extensions/warp-ipfs/src/store/conversation.rs | 2 +- extensions/warp-ipfs/src/store/document/cache.rs | 8 ++++---- extensions/warp-ipfs/src/store/document/conversation.rs | 2 +- extensions/warp-ipfs/src/store/document/image_dag.rs | 9 ++++----- extensions/warp-ipfs/src/store/document/root.rs | 2 +- extensions/warp-ipfs/src/store/queue.rs | 2 +- extensions/warp-ipfs/src/thumbnail.rs | 2 +- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/extensions/warp-ipfs/src/store/conversation.rs b/extensions/warp-ipfs/src/store/conversation.rs index 4a547f8ec..0bcceaf68 100644 --- a/extensions/warp-ipfs/src/store/conversation.rs +++ b/extensions/warp-ipfs/src/store/conversation.rs @@ -13,7 +13,7 @@ use uuid::Uuid; use warp::{ crypto::{cipher::Cipher, did_key::CoreSign, DIDKey, Ed25519KeyPair, KeyMaterial, DID}, error::Error, - logging::tracing::log::info, + logging::tracing::info, raygun::{ Conversation, ConversationType, Message, MessageOptions, MessagePage, MessageReference, Messages, MessagesType, diff --git a/extensions/warp-ipfs/src/store/document/cache.rs b/extensions/warp-ipfs/src/store/document/cache.rs index b24f06f9c..0dbdb9004 100644 --- a/extensions/warp-ipfs/src/store/document/cache.rs +++ b/extensions/warp-ipfs/src/store/document/cache.rs @@ -8,7 +8,7 @@ use futures::{ SinkExt, StreamExt, }; use libipld::Cid; -use rust_ipfs::{Ipfs, IpfsPath}; +use rust_ipfs::Ipfs; use warp::{crypto::DID, error::Error}; use super::identity::IdentityDocument; @@ -216,7 +216,7 @@ impl IdentityCacheTask { if let Some(path) = self.path.as_ref() { let cid = cid.to_string(); if let Err(e) = tokio::fs::write(path.join(".cache_id"), cid).await { - tracing::log::error!("Error writing cid to file: {e}"); + tracing::error!("Error writing cid to file: {e}"); } } @@ -232,7 +232,7 @@ impl IdentityCacheTask { if let Some(path) = self.path.as_ref() { let cid = cid.to_string(); if let Err(e) = tokio::fs::write(path.join(".cache_id"), cid).await { - tracing::log::error!("Error writing cid to file: {e}"); + tracing::error!("Error writing cid to file: {e}"); } } @@ -307,7 +307,7 @@ impl IdentityCacheTask { if let Some(path) = self.path.as_ref() { let cid = cid.to_string(); if let Err(e) = tokio::fs::write(path.join(".cache_id"), cid).await { - tracing::log::error!("Error writing cid to file: {e}"); + tracing::error!("Error writing cid to file: {e}"); } } diff --git a/extensions/warp-ipfs/src/store/document/conversation.rs b/extensions/warp-ipfs/src/store/document/conversation.rs index 02c582f94..a03b5ec9a 100644 --- a/extensions/warp-ipfs/src/store/document/conversation.rs +++ b/extensions/warp-ipfs/src/store/document/conversation.rs @@ -374,7 +374,7 @@ impl ConversationTask { if let Some(path) = self.path.as_ref() { let cid = cid.to_string(); if let Err(e) = tokio::fs::write(path.join(".message_id"), cid).await { - tracing::log::error!("Error writing to '.message_id': {e}.") + tracing::error!("Error writing to '.message_id': {e}.") } } diff --git a/extensions/warp-ipfs/src/store/document/image_dag.rs b/extensions/warp-ipfs/src/store/document/image_dag.rs index fd319418d..7e0bb1f50 100644 --- a/extensions/warp-ipfs/src/store/document/image_dag.rs +++ b/extensions/warp-ipfs/src/store/document/image_dag.rs @@ -3,7 +3,6 @@ use libipld::Cid; use rust_ipfs::{Ipfs, PeerId}; use serde::{Deserialize, Serialize}; use std::task::Poll; -use tracing::log; use warp::{constellation::file::FileType, error::Error, multipass::identity::IdentityImage}; #[derive(Deserialize, Serialize, Debug, Clone)] @@ -39,7 +38,7 @@ pub async fn store_photo( })); } } - log::trace!("{written} bytes written"); + tracing::trace!("{written} bytes written"); } Poll::Ready(Some(rust_ipfs::unixfs::UnixfsStatus::CompletedStatus { path, @@ -47,7 +46,7 @@ pub async fn store_photo( .. })) => { size = written; - log::debug!("Image is written with {written} bytes - stored at {path}"); + tracing::debug!("Image is written with {written} bytes - stored at {path}"); return Poll::Ready(path.root().cid().copied().ok_or(Error::Other)); } Poll::Ready(Some(rust_ipfs::unixfs::UnixfsStatus::FailedStatus { @@ -57,13 +56,13 @@ pub async fn store_photo( })) => { let err = match error { Some(e) => { - log::error!( + tracing::error!( "Error uploading picture with {written} bytes written with error: {e}" ); e.into() } None => { - log::error!("Error uploading picture with {written} bytes written"); + tracing::error!("Error uploading picture with {written} bytes written"); Error::OtherWithContext("Error uploading photo".into()) } }; diff --git a/extensions/warp-ipfs/src/store/document/root.rs b/extensions/warp-ipfs/src/store/document/root.rs index f8a90db41..04a77bf2d 100644 --- a/extensions/warp-ipfs/src/store/document/root.rs +++ b/extensions/warp-ipfs/src/store/document/root.rs @@ -513,7 +513,7 @@ impl RootDocumentTask { if let Some(path) = self.path.as_ref() { let cid = root_cid.to_string(); if let Err(e) = tokio::fs::write(path.join(".id"), cid).await { - tracing::log::error!("Error writing to '.id': {e}.") + tracing::error!("Error writing to '.id': {e}.") } } diff --git a/extensions/warp-ipfs/src/store/queue.rs b/extensions/warp-ipfs/src/store/queue.rs index 346c6c2d6..6555d5c93 100644 --- a/extensions/warp-ipfs/src/store/queue.rs +++ b/extensions/warp-ipfs/src/store/queue.rs @@ -8,7 +8,7 @@ use std::{ use futures::{channel::mpsc, StreamExt}; use rust_ipfs::Ipfs; use tokio::{sync::RwLock, task::JoinHandle}; -use tracing::{error}; +use tracing::error; use warp::{ crypto::{ cipher::Cipher, diff --git a/extensions/warp-ipfs/src/thumbnail.rs b/extensions/warp-ipfs/src/thumbnail.rs index c4296b59b..79258003a 100644 --- a/extensions/warp-ipfs/src/thumbnail.rs +++ b/extensions/warp-ipfs/src/thumbnail.rs @@ -16,7 +16,7 @@ use image::io::Reader as ImageReader; use image::ImageFormat; use tokio::sync::Mutex; use tokio::task::JoinHandle; -use warp::{constellation::file::FileType, error::Error, logging::tracing::log}; +use warp::{constellation::file::FileType, error::Error}; use crate::utils::ExtensionType;