Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifropc committed Dec 21, 2024
1 parent fc109c0 commit 0fdb76c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions cmd/crates/soroban-test/tests/it/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ fn ls(sandbox: &TestEnv) -> Vec<String> {
.collect::<Vec<_>>()
}

pub const NETWORKS: &str = "\
local
pub const NETWORKS: &str = r#"local
futurenet
mainnet
testnet
";
"#;

#[test]
fn set_and_remove_network() {
Expand Down
6 changes: 1 addition & 5 deletions cmd/soroban-cli/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,8 @@ impl Config {
pub fn save(&self) -> Result<(), locator::Error> {
let toml_string = toml::to_string(&self)?;
let path = locator::config_file()?;
let parent = path.parent();
if let Some(parent) = parent {
fs::create_dir_all(parent)?;
}
// Depending on the platform, this function may fail if the full directory path does not exist
let mut file = File::create(path)?;
let mut file = File::create(locator::ensure_directory(path)?)?;
file.write_all(toml_string.as_bytes())?;

Ok(())
Expand Down

0 comments on commit 0fdb76c

Please sign in to comment.