mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-25 05:36:50 +03:00
Clippy
This commit is contained in:
parent
c76cb0b086
commit
9206d55408
@ -41,7 +41,7 @@ impl Command for Init {
|
||||
|
||||
fn apply(self, _: Context, _: Self::Input) -> Result<Self::Output> {
|
||||
// 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
|
||||
|
@ -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 == '-' {
|
||||
|
Loading…
Reference in New Issue
Block a user