diff --git a/cmd/crates/soroban-spec-tools/src/contract.rs b/cmd/crates/soroban-spec-tools/src/contract.rs index 9292583040..9ab23e59a1 100644 --- a/cmd/crates/soroban-spec-tools/src/contract.rs +++ b/cmd/crates/soroban-spec-tools/src/contract.rs @@ -157,12 +157,12 @@ impl Display for Contract { } fn write_func(f: &mut std::fmt::Formatter<'_>, func: &ScSpecFunctionV0) -> std::fmt::Result { - writeln!(f, " • Function: {}", func.name.to_string_lossy())?; + writeln!(f, " • Function: {}", func.name.to_utf8_string_lossy())?; if func.doc.len() > 0 { writeln!( f, " Docs: {}", - &indent(&func.doc.to_string_lossy(), 11).trim() + &indent(&func.doc.to_utf8_string_lossy(), 11).trim() )?; } writeln!( @@ -185,7 +185,7 @@ fn write_union(f: &mut std::fmt::Formatter<'_>, udt: &ScSpecUdtUnionV0) -> std:: writeln!( f, " Docs: {}", - indent(&udt.doc.to_string_lossy(), 10).trim() + indent(&udt.doc.to_utf8_string_lossy(), 10).trim() )?; } writeln!(f, " Cases:")?; @@ -202,7 +202,7 @@ fn write_struct(f: &mut std::fmt::Formatter<'_>, udt: &ScSpecUdtStructV0) -> std writeln!( f, " Docs: {}", - indent(&udt.doc.to_string_lossy(), 10).trim() + indent(&udt.doc.to_utf8_string_lossy(), 10).trim() )?; } writeln!(f, " Fields:")?; @@ -210,7 +210,7 @@ fn write_struct(f: &mut std::fmt::Formatter<'_>, udt: &ScSpecUdtStructV0) -> std writeln!( f, " • {}: {}", - field.name.to_string_lossy(), + field.name.to_utf8_string_lossy(), indent(&format!("{:#?}", field.type_), 8).trim() )?; if field.doc.len() > 0 { @@ -227,7 +227,7 @@ fn write_enum(f: &mut std::fmt::Formatter<'_>, udt: &ScSpecUdtEnumV0) -> std::fm writeln!( f, " Docs: {}", - indent(&udt.doc.to_string_lossy(), 10).trim() + indent(&udt.doc.to_utf8_string_lossy(), 10).trim() )?; } writeln!(f, " Cases:")?; @@ -244,7 +244,7 @@ fn write_error(f: &mut std::fmt::Formatter<'_>, udt: &ScSpecUdtErrorEnumV0) -> s writeln!( f, " Docs: {}", - indent(&udt.doc.to_string_lossy(), 10).trim() + indent(&udt.doc.to_utf8_string_lossy(), 10).trim() )?; } writeln!(f, " Cases:")?; @@ -265,8 +265,12 @@ fn indent(s: &str, n: usize) -> String { fn format_name(lib: &StringM<80>, name: &StringM<60>) -> String { if lib.len() > 0 { - format!("{}::{}", lib.to_string_lossy(), name.to_string_lossy()) + format!( + "{}::{}", + lib.to_utf8_string_lossy(), + name.to_utf8_string_lossy() + ) } else { - name.to_string_lossy() + name.to_utf8_string_lossy() } } diff --git a/cmd/crates/soroban-test/tests/it/config.rs b/cmd/crates/soroban-test/tests/it/config.rs index a0a240af18..eb9494a1a3 100644 --- a/cmd/crates/soroban-test/tests/it/config.rs +++ b/cmd/crates/soroban-test/tests/it/config.rs @@ -188,9 +188,8 @@ fn generate_identity() { #[test] fn seed_phrase() { let sandbox = TestEnv::default(); - let dir = sandbox.dir(); add_identity( - dir, + sandbox.dir(), "test_seed", SecretKind::Seed, "one two three four five six seven eight nine ten eleven twelve", @@ -198,7 +197,6 @@ fn seed_phrase() { sandbox .new_assert_cmd("config") - .current_dir(dir) .arg("identity") .arg("ls") .assert()