sephynox / xrpl-rust

A 100% Rust library to interact with the XRPL. XRPL Grant Winner
https://crates.io/crates/xrpl-rust
ISC License
16 stars 8 forks source link

Implement Default trait #31

Open LimpidCrypto opened 1 year ago

LimpidCrypto commented 1 year ago

Implement the Default for any struct it makes sense. The following example shows how much it makes it easier to define a struct:

let request = AccountInfo {
    account: "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W",
    ..Default::default()
};

Instead of having to define all fields for AccountInfo the user can just define the account and leave the rest to ..Default::default().