Explorar el Código

dnetview: Clippy lint.

Luther Blissett hace 3 años
padre
commit
94cc40781e
Se han modificado 2 ficheros con 3 adiciones y 3 borrados
  1. 2 2
      bin/dnetview/src/main.rs
  2. 1 1
      bin/dnetview/src/parser.rs

+ 2 - 2
bin/dnetview/src/main.rs

@@ -1,5 +1,5 @@
 use async_std::sync::Arc;
 use async_std::sync::Arc;
-use std::{fs::File, io, io::Read, path::PathBuf};
+use std::{fs::File, io, io::Read};
 
 
 use clap::Parser;
 use clap::Parser;
 use darkfi::util::{
 use darkfi::util::{
@@ -114,7 +114,7 @@ async fn main() -> DnetViewResult<()> {
     let log_level = get_log_level(args.verbose.into());
     let log_level = get_log_level(args.verbose.into());
     let log_config = get_log_config();
     let log_config = get_log_config();
 
 
-    let log_file_path = PathBuf::from(expand_path(&args.log_path)?);
+    let log_file_path = expand_path(&args.log_path)?;
     if let Some(parent) = log_file_path.parent() {
     if let Some(parent) = log_file_path.parent() {
         std::fs::create_dir_all(parent)?;
         std::fs::create_dir_all(parent)?;
     };
     };

+ 1 - 1
bin/dnetview/src/parser.rs

@@ -75,7 +75,7 @@ impl DataParser {
             // Parse response
             // Parse response
             match response {
             match response {
                 Ok(reply) => {
                 Ok(reply) => {
-                    if !reply.as_object().is_some() || reply.as_object().unwrap().is_empty() {
+                    if reply.as_object().is_none() || reply.as_object().unwrap().is_empty() {
                         return Err(DnetViewError::EmptyRpcReply)
                         return Err(DnetViewError::EmptyRpcReply)
                     }
                     }