From 9206d55408c0357a9553392e53cab8056605c73a Mon Sep 17 00:00:00 2001 From: howardwu Date: Wed, 24 Feb 2021 19:43:03 -0800 Subject: [PATCH] Clippy --- leo/commands/init.rs | 2 +- package/src/package.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/leo/commands/init.rs b/leo/commands/init.rs index f2703046c8..7c6b3e7745 100644 --- a/leo/commands/init.rs +++ b/leo/commands/init.rs @@ -41,7 +41,7 @@ impl Command for Init { fn apply(self, _: Context, _: Self::Input) -> Result { // Derive the package directory path. - let mut path = current_dir()?; + let path = current_dir()?; // Check that the given package name is valid. let package_name = path diff --git a/package/src/package.rs b/package/src/package.rs index b559c7ac90..f5c46e2696 100644 --- a/package/src/package.rs +++ b/package/src/package.rs @@ -55,12 +55,12 @@ impl Package { /// by a single dash '-'. pub fn is_package_name_valid(package_name: &str) -> bool { // Check that the package name is nonempty. - if package_name.len() == 0 { + if package_name.is_empty() { tracing::error!("Project names must be nonempty"); return false; } - let mut previous = package_name.chars().nth(0).unwrap(); + let mut previous = package_name.chars().next().unwrap(); // Check that the first character is not a dash. if previous == '-' {