Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit f50f7ee

Browse files
authored
Remove need for 04/16 nightly rust (#689)
1 parent ec6f2c1 commit f50f7ee

File tree

13 files changed

+40
-39
lines changed

13 files changed

+40
-39
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
- uses: actions-rs/toolchain@v1
1212
with:
13-
toolchain: nightly-2023-04-16
13+
toolchain: nightly
1414
components: clippy
1515
target: wasm32-unknown-unknown
1616
override: true
@@ -45,7 +45,7 @@ jobs:
4545

4646
- uses: actions-rs/toolchain@v1
4747
with:
48-
toolchain: nightly-2023-04-16
48+
toolchain: nightly
4949
components: clippy
5050
target: wasm32-unknown-unknown
5151
override: true
@@ -68,11 +68,11 @@ jobs:
6868

6969
- name: Build wasm
7070
env:
71-
RUSTUP_TOOLCHAIN: nightly-2023-04-16
71+
RUSTUP_TOOLCHAIN: nightly
7272
run: wasm-pack build ./mutiny-wasm --release --target web --scope mutinywallet
7373

7474
- name: Publish wasm
7575
run: wasm-pack publish --access public -t web
7676
env:
77-
RUSTUP_TOOLCHAIN: nightly-2023-04-16
77+
RUSTUP_TOOLCHAIN: nightly
7878
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
- name: Install nightly toolchain
2525
uses: actions-rs/toolchain@v1
2626
with:
27-
toolchain: nightly-2023-04-16
27+
toolchain: nightly
2828
components: rustfmt
2929
profile: minimal
3030

3131
- name: Check formatting
3232
run: |
33-
cargo +nightly-2023-04-16 fmt -- --check
33+
cargo +nightly fmt -- --check
3434
3535
website:
3636
name: Build WASM binary
@@ -39,7 +39,7 @@ jobs:
3939
- uses: actions/checkout@v3
4040
- uses: actions-rs/toolchain@v1
4141
with:
42-
toolchain: nightly-2023-04-16
42+
toolchain: nightly
4343
target: wasm32-unknown-unknown
4444
override: true
4545
profile: minimal
@@ -61,20 +61,20 @@ jobs:
6161
6262
- name: Build wasm package
6363
env:
64-
RUSTUP_TOOLCHAIN: nightly-2023-04-16
64+
RUSTUP_TOOLCHAIN: nightly
6565
run: wasm-pack build ./mutiny-wasm --release --target web
6666

6767
browser_tests:
6868
name: Browser Tests
6969
runs-on: ubuntu-latest
7070
env:
71-
RUSTUP_TOOLCHAIN: nightly-2023-04-16
71+
RUSTUP_TOOLCHAIN: nightly
7272
WASM_BINDGEN_TEST_TIMEOUT: 240
7373
steps:
7474
- uses: actions/checkout@v3
7575
- uses: actions-rs/toolchain@v1
7676
with:
77-
toolchain: nightly-2023-04-16
77+
toolchain: nightly
7878
target: wasm32-unknown-unknown
7979
override: true
8080
profile: minimal
@@ -112,7 +112,7 @@ jobs:
112112
- uses: actions/checkout@v3
113113
- uses: actions-rs/toolchain@v1
114114
with:
115-
toolchain: nightly-2023-04-16
115+
toolchain: nightly
116116
components: clippy
117117
target: wasm32-unknown-unknown
118118
override: true
@@ -155,7 +155,7 @@ jobs:
155155
- name: Install Rust
156156
uses: actions-rs/toolchain@v1
157157
with:
158-
toolchain: nightly-2023-04-16
158+
toolchain: nightly
159159
override: true
160160
profile: minimal
161161
components: clippy
@@ -202,7 +202,7 @@ jobs:
202202
- name: Install Rust
203203
uses: actions-rs/toolchain@v1
204204
with:
205-
toolchain: nightly-2023-04-16
205+
toolchain: nightly
206206
override: true
207207
profile: minimal
208208
components: clippy
@@ -249,7 +249,7 @@ jobs:
249249
- name: Install Rust
250250
uses: actions-rs/toolchain@v1
251251
with:
252-
toolchain: nightly-2023-04-16
252+
toolchain: nightly
253253
override: true
254254
profile: minimal
255255
components: clippy

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ AR=/opt/homebrew/opt/llvm/bin/llvm-ar CC=/opt/homebrew/opt/llvm/bin/clang
2929

3030
### Dependencies
3131

32-
- [rust](https://www.rust-lang.org/) (specifically, nightly: `rustup toolchain install nightly-2023-04-16` and `rustup target add wasm32-unknown-unknown --toolchain nightly-2023-04-16`)
32+
- [rust](https://www.rust-lang.org/) (specifically, nightly: `rustup toolchain install nightly` and `rustup target add wasm32-unknown-unknown --toolchain nightly`)
3333

3434
- [node](https://nodejs.org/en/)
3535

mutiny-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ log = "=0.4.18"
5050
futures = "0.3.25"
5151
thiserror = "1.0"
5252
anyhow = "1.0"
53-
miniscript = { version = "9.0.0", default-features = false, features = ["no-std"] }
53+
miniscript = { version = "9.0.1", default-features = false, features = ["no-std"] }
5454

5555
[dev-dependencies]
5656
wasm-bindgen-test = "0.3.33"

mutiny-core/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "nightly-2023-04-16"
2+
default = "nightly"

mutiny-core/src/gossip.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,7 @@ impl LnPeerMetadata {
335335
};
336336

337337
// combine nodes from both
338-
let mut nodes: Vec<String> = primary
339-
.nodes
340-
.into_iter()
341-
.chain(secondary.nodes.into_iter())
342-
.collect();
338+
let mut nodes: Vec<String> = primary.nodes.into_iter().chain(secondary.nodes).collect();
343339

344340
// remove duplicates
345341
nodes.sort();

mutiny-core/src/ldkstorage.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,10 @@ impl<S: MutinyStorage> MutinyNodePersister<S> {
134134
.scan(MONITORS_PREFIX_KEY, Some(suffix))
135135
.map_err(|_| io::ErrorKind::Other)?;
136136

137-
let res = channel_monitor_list
138-
.iter()
139-
.fold(Ok(Vec::new()), |current_res, (_, data)| match current_res {
140-
Err(e) => Err(e),
141-
Ok(mut accum) => {
137+
let res =
138+
channel_monitor_list
139+
.into_iter()
140+
.try_fold(Vec::new(), |mut accum, (_, data)| {
142141
let mut buffer = Cursor::new(data);
143142
match <(BlockHash, ChannelMonitor<InMemorySigner>)>::read(
144143
&mut buffer,
@@ -153,8 +152,7 @@ impl<S: MutinyStorage> MutinyNodePersister<S> {
153152
format!("Failed to deserialize ChannelMonitor: {e}"),
154153
)),
155154
}
156-
}
157-
})?;
155+
})?;
158156

159157
Ok(res)
160158
}
@@ -256,8 +254,12 @@ impl<S: MutinyStorage> MutinyNodePersister<S> {
256254
channel_monitor_mut_references,
257255
);
258256
let mut readable_kv_value = Cursor::new(bytes);
259-
let Ok((_, channel_manager)) = <(BlockHash, PhantomChannelManager<S>)>::read(&mut readable_kv_value, read_args) else {
260-
return Err(MutinyError::ReadError { source: MutinyStorageError::Other(anyhow!("could not read manager")) })
257+
let Ok((_, channel_manager)) =
258+
<(BlockHash, PhantomChannelManager<S>)>::read(&mut readable_kv_value, read_args)
259+
else {
260+
return Err(MutinyError::ReadError {
261+
source: MutinyStorageError::Other(anyhow!("could not read manager")),
262+
});
261263
};
262264
Ok(ReadChannelManager {
263265
channel_manager,

mutiny-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![allow(
44
incomplete_features,
55
clippy::extra_unused_type_parameters,
6+
clippy::arc_with_non_send_sync,
67
type_alias_bounds
78
)]
89
#![feature(io_error_other)]

mutiny-core/src/nodemanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ impl<S: MutinyStorage> NodeManager<S> {
11691169
log_warn!(self.logger, "Failed to get bdk history: {e}");
11701170
e
11711171
})
1172-
.unwrap_or(vec![]);
1172+
.unwrap_or_default();
11731173

11741174
let mut activity = Vec::with_capacity(lightning.len() + onchain.len());
11751175
for ln in lightning {
@@ -2117,7 +2117,7 @@ impl<S: MutinyStorage> NodeManager<S> {
21172117
.collect();
21182118

21192119
// correctly set is_connected
2120-
for mut peer in &mut storage_peers {
2120+
for peer in &mut storage_peers {
21212121
if connected_peers.contains(&peer.pubkey) {
21222122
peer.is_connected = true;
21232123
}

mutiny-core/src/nostr/nwc.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,7 @@ pub struct PendingNwcInvoice {
345345

346346
impl PartialOrd for PendingNwcInvoice {
347347
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
348-
self.invoice
349-
.to_string()
350-
.partial_cmp(&other.invoice.to_string())
348+
Some(self.cmp(other))
351349
}
352350
}
353351

0 commit comments

Comments
 (0)