Skip to content

Commit 5ff9efa

Browse files
fix: remove unused argument
1 parent f639c75 commit 5ff9efa

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

crates/cli/src/config.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ pub struct ProjectConfig {
6161

6262
impl ProjectConfig {
6363
// return None if config file does not exist
64-
fn discover_project(config_path: Option<PathBuf>, base: Option<&Path>) -> Result<Option<Self>> {
65-
let config_path =
66-
find_config_path_with_default(config_path, base).context(EC::ReadConfiguration)?;
64+
fn discover_project(config_path: Option<PathBuf>) -> Result<Option<Self>> {
65+
let config_path = find_config_path_with_default(config_path).context(EC::ReadConfiguration)?;
6766
// NOTE: if config file does not exist, return None
6867
// this is not 100% correct because of racing condition
6968
if !config_path.is_file() {
@@ -90,7 +89,7 @@ impl ProjectConfig {
9089
}
9190
// do not report error if no sgconfig.yml is found
9291
pub fn setup(config_path: Option<PathBuf>) -> Result<Option<Self>> {
93-
let Some(config) = Self::discover_project(config_path, None)? else {
92+
let Some(config) = Self::discover_project(config_path)? else {
9493
return Ok(None);
9594
};
9695
register_custom_language(&config.project_dir, config.sg_config.clone())?;
@@ -206,18 +205,11 @@ pub fn read_rule_file(
206205

207206
const CONFIG_FILE: &str = "sgconfig.yml";
208207

209-
fn find_config_path_with_default(
210-
config_path: Option<PathBuf>,
211-
base: Option<&Path>,
212-
) -> Result<PathBuf> {
208+
fn find_config_path_with_default(config_path: Option<PathBuf>) -> Result<PathBuf> {
213209
if let Some(config) = config_path {
214210
return Ok(config);
215211
}
216-
let mut path = if let Some(base) = base {
217-
base.to_path_buf()
218-
} else {
219-
std::env::current_dir()?
220-
};
212+
let mut path = std::env::current_dir()?;
221213
loop {
222214
let maybe_config = path.join(CONFIG_FILE);
223215
if maybe_config.exists() {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy