Skip to content

Commit 4fa6d6e

Browse files
committed
Fix lints
1 parent e536cc3 commit 4fa6d6e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

crates/cli/src/subcommands/init.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
mod template;
2+
23
use crate::util::ModuleLanguage;
34
use crate::Config;
45
use crate::{detect::find_executable, util::UNSTABLE_WARNING};
56
use anyhow::Context;
67
use clap::{Arg, ArgMatches};
78
use colored::Colorize;
89
use std::path::{Path, PathBuf};
10+
911
use template as init_template;
1012

1113
pub fn cli() -> clap::Command {

crates/cli/src/subcommands/init/template.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use anyhow::{Context, Result};
22
use clap::ArgMatches;
33
use colored::Colorize;
44
use dialoguer::{theme::ColorfulTheme, Confirm, Input, Select};
5-
use git2::Repository;
65
use regex::Regex;
76
use reqwest::Url;
87
use serde::{Deserialize, Serialize};
@@ -304,7 +303,7 @@ pub async fn exec_non_interactive_init(config: &mut Config, args: &ArgMatches) -
304303
Ok(())
305304
}
306305

307-
pub fn ensure_empty_directory(project_name: &str, project_path: &Path) -> Result<()> {
306+
pub fn ensure_empty_directory(_project_name: &str, project_path: &Path) -> Result<()> {
308307
if project_path.exists() {
309308
if !project_path.is_dir() {
310309
anyhow::bail!(
@@ -399,7 +398,7 @@ pub async fn interactive_init() -> Result<TemplateConfig> {
399398
.interact()?;
400399

401400
let other_index = highlights.len();
402-
let none_index = highlights.len() + 1;
401+
let _none_index = highlights.len() + 1;
403402

404403
if client_selection < highlights.len() {
405404
let highlight = &highlights[client_selection];
@@ -503,7 +502,7 @@ fn clone_git_subdirectory(repo_url: &str, subdir: &str, target: &Path, branch: O
503502
let mut fetch_options = git2::FetchOptions::new();
504503
let mut callbacks = git2::RemoteCallbacks::new();
505504

506-
callbacks.credentials(|url, username_from_url, allowed_types| {
505+
callbacks.credentials(|_url, username_from_url, allowed_types| {
507506
if allowed_types.contains(git2::CredentialType::SSH_KEY) {
508507
if let Some(username) = username_from_url {
509508
return git2::Cred::ssh_key_from_agent(username);
@@ -553,7 +552,7 @@ fn clone_github_template(repo_input: &str, target: &Path) -> Result<()> {
553552
let mut fetch_options = git2::FetchOptions::new();
554553
let mut callbacks = git2::RemoteCallbacks::new();
555554

556-
callbacks.credentials(|url, username_from_url, allowed_types| {
555+
callbacks.credentials(|_url, username_from_url, allowed_types| {
557556
if allowed_types.contains(git2::CredentialType::SSH_KEY) {
558557
if let Some(username) = username_from_url {
559558
return git2::Cred::ssh_key_from_agent(username);
@@ -623,7 +622,7 @@ fn configure_rust_server(server_dir: &Path, project_name: &str) -> Result<()> {
623622
Ok(())
624623
}
625624

626-
fn create_root_package_json(root: &Path, project_name: &str, use_local: bool) -> Result<()> {
625+
fn create_root_package_json(root: &Path, project_name: &str, _use_local: bool) -> Result<()> {
627626
let package_json = json!({
628627
"name": project_name,
629628
"version": "0.1.0",

0 commit comments

Comments
 (0)