Skip to content

Commit

Permalink
Remove unused function.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando committed Nov 5, 2024
1 parent a583e9d commit cbdb0be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
7 changes: 5 additions & 2 deletions cmd/soroban-cli/src/commands/env/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use crate::{
commands::global,
config::locator::{self, config},
config::{
locator::{self},
Config,
},
};
use clap::Parser;

Expand All @@ -21,7 +24,7 @@ pub enum Error {

impl Cmd {
pub fn run(&self, _global_args: &global::Args) -> Result<(), Error> {
let config = config()?;
let config = Config::new()?;
let mut lines: Vec<(String, String)> = Vec::new();

if let Some(data) = get("STELLAR_NETWORK", config.defaults.network) {
Expand Down
13 changes: 0 additions & 13 deletions cmd/soroban-cli/src/config/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,16 +517,3 @@ pub fn global_config_path() -> Result<PathBuf, Error> {
pub fn config_file() -> Result<PathBuf, Error> {
Ok(global_config_path()?.join("config.toml"))
}

pub fn config() -> Result<Config, Error> {
let path = config_file()?;

if path.exists() {
let data = fs::read(&path).map_err(|_| Error::FileRead { path })?;
let config: Config = toml::from_slice(data.as_slice())?;

Ok(config)
} else {
Ok(Config::new()?)
}
}

0 comments on commit cbdb0be

Please sign in to comment.