stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
128 stars 67 forks source link

Add Address::from_str #1342

Closed leighmcculloch closed 2 months ago

leighmcculloch commented 2 months ago

What

Add Address::from_str.

Why

For convenient conversions directly from a &str to an Address in tests:

Address::from_str(&env, "C...")

It is possible to do the same with:

Address::from_string(String::from_str(&env, "C..."))

But that is so verbose, the nested fn calls often get rustfmted to span multiple lines.