51 lines
1.5 KiB
Diff
51 lines
1.5 KiB
Diff
commit 62d3567c42de318da828149759c6bb2f71c13de7
|
|
Author: q66 <daniel@octaforge.org>
|
|
Date: Wed Mar 10 22:52:10 2021 +0100
|
|
|
|
fix AtomicU64 in jsonrpc (breaks build on ppc32)
|
|
|
|
diff --git crates/jsonrpc/src/client.rs crates/jsonrpc/src/client.rs
|
|
index 7d71428..3245e24 100644
|
|
--- a/crates/jsonrpc/src/client.rs
|
|
+++ b/crates/jsonrpc/src/client.rs
|
|
@@ -7,7 +7,7 @@ use futures::{
|
|
};
|
|
use serde::Serialize;
|
|
use serde_json::json;
|
|
-use std::sync::atomic::{AtomicU64, Ordering};
|
|
+use std::sync::atomic::{AtomicUsize, Ordering};
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
@@ -19,7 +19,7 @@ pub trait ResponseHandler {
|
|
#[derive(Debug)]
|
|
pub struct Client {
|
|
output: mpsc::Sender<String>,
|
|
- request_id: AtomicU64,
|
|
+ request_id: AtomicUsize,
|
|
senders_by_id: CHashMap<Id, oneshot::Sender<Result<serde_json::Value>>>,
|
|
}
|
|
|
|
@@ -27,7 +27,7 @@ impl Client {
|
|
pub fn new(output: mpsc::Sender<String>) -> Self {
|
|
Self {
|
|
output,
|
|
- request_id: AtomicU64::new(0),
|
|
+ request_id: AtomicUsize::new(0),
|
|
senders_by_id: CHashMap::new(),
|
|
}
|
|
}
|
|
diff --git crates/jsonrpc/src/types.rs crates/jsonrpc/src/types.rs
|
|
index 30036d1..c1a2dce 100644
|
|
--- a/crates/jsonrpc/src/types.rs
|
|
+++ b/crates/jsonrpc/src/types.rs
|
|
@@ -6,7 +6,7 @@ pub const PROTOCOL_VERSION: &str = "2.0";
|
|
#[derive(Debug, Eq, Hash, PartialEq, Clone, Deserialize, Serialize)]
|
|
#[serde(untagged)]
|
|
pub enum Id {
|
|
- Number(u64),
|
|
+ Number(usize),
|
|
String(String),
|
|
}
|
|
|