summaryrefslogtreecommitdiffstats
path: root/ipfs-cli
diff options
context:
space:
mode:
authorSameer Puri <11097096+sameer@users.noreply.github.com>2018-12-31 16:29:00 -0500
committerSameer Puri <11097096+sameer@users.noreply.github.com>2018-12-31 16:29:00 -0500
commit2704d2b28996808fe4d20138034e1af81ddc8b0e (patch)
treeb1107cfa3cedfa75805dd91bb7029ee2e50e5c9c /ipfs-cli
parente7542e68ce88665290ce4a6af6334f34e1479c5c (diff)
Run cargo fmt
Diffstat (limited to 'ipfs-cli')
-rw-r--r--ipfs-cli/src/command/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/ipfs-cli/src/command/mod.rs b/ipfs-cli/src/command/mod.rs
index 969f872..86f9aa5 100644
--- a/ipfs-cli/src/command/mod.rs
+++ b/ipfs-cli/src/command/mod.rs
@@ -6,12 +6,12 @@
// copied, modified, or distributed except according to those terms.
//
-use std::path::Path;
use clap::{App, ArgMatches};
use futures::Future;
use ipfs_api::IpfsClient;
use std::error::Error;
use std::fs;
+use std::path::Path;
pub type CommandExecutable = Box<Future<Item = (), Error = ()> + 'static + Send>;
@@ -19,7 +19,10 @@ pub const EXPECTED_FILE: &str = "expected to read input file";
/// Verifies that a path points to a file that exists, and not a directory.
///
-pub fn verify_file<P>(path: P) -> Result<(), String> where P: AsRef<Path> {
+pub fn verify_file<P>(path: P) -> Result<(), String>
+where
+ P: AsRef<Path>,
+{
match fs::metadata(path) {
Ok(ref metadata) if metadata.is_file() => Ok(()),
Ok(_) => Err("file must not be a directory".into()),