Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Nov 22, 2023
1 parent ed4459c commit 2f4e91e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
28 changes: 17 additions & 11 deletions core/src/core.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use crate::imports::*;
use crate::runtime::Runtime;
use crate::sync::SyncStatus;
use std::borrow::Cow;
use egui::load::Bytes;
use egui_notify::Toasts;
use kaspa_metrics::MetricsSnapshot;
use kaspa_wallet_core::api::TransactionDataGetResponse;
use kaspa_wallet_core::events::Events as CoreWallet;
use kaspa_wallet_core::storage::{Binding, Hint};
use std::borrow::Cow;
use workflow_i18n::*;

enum Status {
Expand Down Expand Up @@ -72,7 +72,6 @@ impl State {
pub fn current_daa_score(&self) -> Option<u64> {
self.current_daa_score
}

}

pub struct Core {
Expand Down Expand Up @@ -299,7 +298,6 @@ impl Core {
settings: settings.clone(),
toasts: Toasts::default(),
// status_bar_message: None,

default_style,
large_style,

Expand Down Expand Up @@ -702,7 +700,6 @@ impl Core {

self.module.status_bar(ui);


ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
if icons()
.sliders
Expand Down Expand Up @@ -772,14 +769,24 @@ impl Core {

match self.settings.node.node_kind {
KaspadNodeKind::Remote => {
match KaspaRpcClient::parse_url(Some(self.settings.node.wrpc_url.clone()), self.settings.node.wrpc_encoding, self.settings.node.network.into()) {
match KaspaRpcClient::parse_url(
Some(self.settings.node.wrpc_url.clone()),
self.settings.node.wrpc_encoding,
self.settings.node.network.into(),
) {
Ok(url) => {
ui.label(format!("Connecting to {} ...", url.unwrap_or("?".to_string())));
ui.label(format!(
"Connecting to {} ...",
url.unwrap_or("?".to_string())
));
}
Err(err) => {
ui.label(
RichText::new(format!("Error connecting to {}: {err}",self.settings.node.wrpc_url))
.color(theme().warning_color),
RichText::new(format!(
"Error connecting to {}: {err}",
self.settings.node.wrpc_url
))
.color(theme().warning_color),
);
}
}
Expand All @@ -788,7 +795,6 @@ impl Core {
ui.label("Connecting...");
}
}

}
#[cfg(not(target_arch = "wasm32"))]
_ => {
Expand Down Expand Up @@ -829,8 +835,8 @@ impl Core {
// if peers.unwrap_or(0) != 0 {
// ui.label("ONLINE");
// } else {
ui.label("CONNECTED").on_hover_ui(|ui|{
ui.horizontal(|ui|{
ui.label("CONNECTED").on_hover_ui(|ui| {
ui.horizontal(|ui| {
// ui.label("Connected to ");
ui.label(self.settings.node.wrpc_url.clone());
});
Expand Down
1 change: 0 additions & 1 deletion core/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ impl Runtime {
pub fn request_repaint(&self) {
self.repaint_service().trigger();
}

}

static mut RUNTIME: Option<Runtime> = None;
Expand Down
4 changes: 1 addition & 3 deletions core/src/runtime/services/metrics_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub struct MetricsService {

impl MetricsService {
pub fn new(application_events: ApplicationEventsChannel, _settings: &Settings) -> Self {

let metrics = Arc::new(Metrics::default());
let metrics_data = Metric::list()
.into_iter()
Expand Down Expand Up @@ -126,8 +125,7 @@ impl Service for MetricsService {
Ok(())
}

fn terminate(self: Arc<Self>) {
}
fn terminate(self: Arc<Self>) {}

async fn join(self: Arc<Self>) -> Result<()> {
Ok(())
Expand Down

0 comments on commit 2f4e91e

Please sign in to comment.