Skip to content

Commit 4dfed0b

Browse files
committed
fix build
1 parent d0f4fbb commit 4dfed0b

File tree

14 files changed

+57
-55
lines changed

14 files changed

+57
-55
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ jobs:
390390
uses: actions-rs/[email protected]
391391
with:
392392
crate: uniffi_bindgen
393-
version: 0.21.1
393+
version: 0.29.3
394394
use-tool-cache: true
395395

396396
- name: Clippy and fmt

src/chain-wallet-libs/bindings/wallet-c/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ pub type EncryptingVoteKeyPtr = *mut EncryptingVoteKey;
4949
/// # parameters
5050
///
5151
/// * account_key: the Ed25519 extended key used wallet's account address private key
52-
/// in the form of a 64 bytes array.
52+
/// in the form of a 64 bytes array.
5353
/// * utxo_keys: an array of Ed25519 extended keys in the form of 64 bytes, used as utxo
54-
/// keys for the wallet
54+
/// keys for the wallet
5555
/// * utxo_keys_len: the number of keys in the utxo_keys array (not the number of bytes)
5656
/// * wallet_out: the recovered wallet
5757
///

src/chain-wallet-libs/bindings/wallet-core/src/c/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ pub const NONCES_SIZE: usize = 8 * 4;
4141
/// # parameters
4242
///
4343
/// * account_key: the Ed25519 extended key used wallet's account address private key
44-
/// in the form of a 64 bytes array.
44+
/// in the form of a 64 bytes array.
4545
/// * utxo_keys: an array of Ed25519 keys in the form of 64 bytes, used as utxo
46-
/// keys for the wallet
46+
/// keys for the wallet
4747
/// * utxo_keys_len: the number of keys in the utxo_keys array (not the number of bytes)
4848
/// * wallet_out: the recovered wallet
4949
///

src/chain-wallet-libs/wallet/src/states.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ where
6262

6363
/// check wether the given state associate to this key is present
6464
/// in the States
65-
pub fn contains<Q: ?Sized>(&self, key: &Q) -> bool
65+
pub fn contains<Q>(&self, key: &Q) -> bool
6666
where
6767
K: Borrow<Q>,
68-
Q: Hash + Eq,
68+
Q: ?Sized + Hash + Eq,
6969
{
7070
self.states.contains_key(key)
7171
}
@@ -77,10 +77,10 @@ where
7777
assert!(self.states.insert(key, state).is_none());
7878
}
7979

80-
pub fn confirm<Q: ?Sized>(&mut self, key: &Q)
80+
pub fn confirm<Q>(&mut self, key: &Q)
8181
where
8282
K: Borrow<Q>,
83-
Q: Hash + Eq,
83+
Q: ?Sized + Hash + Eq,
8484
{
8585
if let Some(state) = self.states.get_mut(key) {
8686
state.confirm();

src/event-db/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct EventDB {
3737
/// * `url` set to the postgres connection string needed to connect to the
3838
/// database. IF it is None, then the env var "`DATABASE_URL`" will be used
3939
/// for this connection string. eg:
40-
/// "`postgres://catalyst-dev:CHANGE_ME@localhost/CatalystDev`"
40+
/// "`postgres://catalyst-dev:CHANGE_ME@localhost/CatalystDev`"
4141
///
4242
/// # Errors
4343
///

src/event-db/src/queries/search.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl EventDB {
4949
format!(
5050
"WHERE {0}.{1} LIKE '%{2}%'",
5151
table,
52-
filter.column.to_string(),
52+
filter.column,
5353
filter.search
5454
)
5555
.as_str(),
@@ -59,7 +59,7 @@ impl EventDB {
5959
format!(
6060
"AND {0}.{1} LIKE '%{2}%'",
6161
table,
62-
filter.column.to_string(),
62+
filter.column,
6363
filter.search
6464
)
6565
.as_str(),
@@ -78,18 +78,18 @@ impl EventDB {
7878
format!(
7979
"ORDER BY {0}.{1} {2}",
8080
table,
81-
order_by.column.to_string(),
81+
order_by.column,
8282
order_type
8383
)
8484
.as_str(),
8585
);
8686
for order_by in order_by_iter {
8787
let order_type = if order_by.descending { "DESC" } else { "ASC" };
8888
order_by_clause.push_str(
89-
format!(
90-
", {0}.{1} LIKE '%{2}%'",
89+
format!(
90+
", {0}.{1} {2}",
9191
table,
92-
order_by.column.to_string(),
92+
order_by.column,
9393
order_type
9494
)
9595
.as_str(),

src/event-db/src/types/search.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::fmt::Display;
12
use super::{event::EventSummary, objective::ObjectiveSummary, proposal::ProposalSummary};
23

34
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -16,15 +17,16 @@ pub enum SearchColumn {
1617
Funds,
1718
}
1819

19-
impl ToString for SearchColumn {
20-
fn to_string(&self) -> String {
21-
match self {
20+
impl Display for SearchColumn {
21+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22+
let str = match self {
2223
SearchColumn::Title => "title".to_string(),
2324
SearchColumn::Type => "type".to_string(),
2425
SearchColumn::Description => "description".to_string(),
2526
SearchColumn::Author => "author".to_string(),
2627
SearchColumn::Funds => "funds".to_string(),
27-
}
28+
};
29+
write!(f, "{}", str)
2830
}
2931
}
3032

src/jormungandr/jormungandr/src/blockchain/process.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ pub struct TaskData {
6161
/// The blockchain process is comprised mainly of two parts:
6262
///
6363
/// * Bookkeeping of all blocks known to the node:
64-
/// This is the most resource heavy operation but can be parallelized depending on the chain structure.
64+
/// This is the most resource heavy operation but can be parallelized depending on the chain structure.
6565
/// * Tip selection and update:
66-
/// Tip updates must be serialized to avoid inconsistent states but are very light on resources.
67-
/// No performance penalty should come from this synchronization point.
66+
/// Tip updates must be serialized to avoid inconsistent states but are very light on resources.
67+
/// No performance penalty should come from this synchronization point.
6868
struct Process {
6969
blockchain: Blockchain,
7070
blockchain_tip: Tip,

src/jormungandr/testing/jormungandr-automation/src/jormungandr/grpc/server/controller.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ impl MockController {
3232
}
3333
}
3434

35-
pub fn finish_and_verify_that<F: 'static + std::marker::Send>(
35+
pub fn finish_and_verify_that<F>(
3636
self,
3737
verify_func: F,
3838
) -> MockExitCode
3939
where
40-
F: Fn(&MockVerifier) -> bool,
40+
F: 'static + std::marker::Send + Fn(&MockVerifier) -> bool,
4141
{
4242
let start = Instant::now();
4343
let timeout = Duration::from_secs(120);

src/jormungandr/testing/jormungandr-automation/src/testing/benchmark/sync/report.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ impl MeasurementReporter {
3030
self.counter >= self.interval
3131
}
3232

33-
pub fn do_if_interval_reached<F: std::marker::Send>(&self, method: F)
33+
pub fn do_if_interval_reached<F>(&self, method: F)
3434
where
35-
F: Fn(),
35+
F: std::marker::Send + Fn(),
3636
{
3737
if self.is_interval_reached() {
3838
method();
3939
}
4040
}
4141

42-
pub fn do_if_interval_reached_and_inc<F: std::marker::Send>(&mut self, method: F)
42+
pub fn do_if_interval_reached_and_inc<F>(&mut self, method: F)
4343
where
44-
F: Fn(),
44+
F: std::marker::Send + Fn(),
4545
{
4646
if self.is_interval_reached() {
4747
method();

0 commit comments

Comments
 (0)