Skip to content

Commit

Permalink
chore: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Im-Beast committed Jan 5, 2025
1 parent 962647f commit 85249ef
Show file tree
Hide file tree
Showing 4 changed files with 597 additions and 208 deletions.
9 changes: 6 additions & 3 deletions impls/monero.rs/build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use bindgen::EnumVariation;
use std::env;
use std::fs::{self, OpenOptions};
use std::io::Write;
use std::path::PathBuf;
use bindgen::EnumVariation;

#[cfg(unix)]
use std::os::unix::fs as unix_fs;
Expand Down Expand Up @@ -100,7 +100,9 @@ fn main() {
.blocklist_type("_.*")
.blocklist_function("__.*")
.layout_tests(false)
.default_enum_style(EnumVariation::Rust { non_exhaustive: false })
.default_enum_style(EnumVariation::Rust {
non_exhaustive: false,
})
.derive_default(false)
.conservative_inline_namespaces()
.generate_comments(false)
Expand Down Expand Up @@ -129,7 +131,8 @@ fn main() {
.open(out_path.clone())
.expect("Failed to open bindings.rs");

file.write_all(new_contents.as_bytes()).expect("Failed to write to bindings.rs");
file.write_all(new_contents.as_bytes())
.expect("Failed to write to bindings.rs");
}
}
}
7 changes: 4 additions & 3 deletions impls/monero.rs/example/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use monero_c_rust::{NetworkType, WalletError, WalletManager, WalletConfig};
use monero_c_rust::{NetworkType, WalletConfig, WalletError, WalletManager};
use tempfile::TempDir;

fn main() -> Result<(), WalletError> {
Expand Down Expand Up @@ -27,7 +27,7 @@ fn main() -> Result<(), WalletError> {
// Initialize the wallet.
let config = WalletConfig {
daemon_address: "xmr-node.cakewallet.com:18081".to_string(),
upper_transaction_size_limit: 10000, // TODO: use sane value.
upper_transaction_size_limit: 0, // TODO: use sane value.
daemon_username: "".to_string(),
daemon_password: "".to_string(),
use_ssl: false,
Expand Down Expand Up @@ -66,7 +66,8 @@ fn main() -> Result<(), WalletError> {

// Clean up the wallet.
std::fs::remove_file(wallet_str).expect("Failed to delete test wallet");
std::fs::remove_file(format!("{}.keys", wallet_str)).expect("Failed to delete test wallet keys");
std::fs::remove_file(format!("{}.keys", wallet_str))
.expect("Failed to delete test wallet keys");

Ok(())
}
Loading

0 comments on commit 85249ef

Please sign in to comment.