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 == '-' {