Skip to content

Commit 2456d78

Browse files
StackOverflowExcept1onbreathx
authored andcommitted
chore: bump rust version to latest nightly (#3571)
1 parent b34ed67 commit 2456d78

File tree

37 files changed

+77
-74
lines changed

37 files changed

+77
-74
lines changed

common/numerated/src/interval.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ mod tests {
441441
#[test]
442442
fn size() {
443443
assert_eq!(Interval::<u8>::try_from(11..111).unwrap().size(), Some(100),);
444-
assert_eq!(Interval::<u8>::try_from(..1).unwrap().size(), Some(1),);
444+
assert_eq!(Interval::<u8>::from(..1).size(), Some(1),);
445445
assert_eq!(Interval::<u8>::from(..=1).size(), Some(2));
446446
assert_eq!(Interval::<u8>::from(1..).size(), Some(255));
447447
assert_eq!(Interval::<u8>::from(0..).size(), None);
@@ -452,15 +452,15 @@ mod tests {
452452
Interval::<u8>::try_from(11..111).unwrap().raw_size(),
453453
Some(100),
454454
);
455-
assert_eq!(Interval::<u8>::try_from(..1).unwrap().raw_size(), Some(1),);
455+
assert_eq!(Interval::<u8>::from(..1).raw_size(), Some(1),);
456456
assert_eq!(Interval::<u8>::from(..=1).raw_size(), Some(2));
457457
assert_eq!(Interval::<u8>::from(1..).raw_size(), Some(255));
458458
assert_eq!(Interval::<u8>::from(0..).raw_size(), None);
459459
assert_eq!(Interval::<u8>::from(..).raw_size(), None);
460460
assert_eq!(Interval::<u8>::try_from(1..1).unwrap().raw_size(), Some(0));
461461

462462
assert_eq!(Interval::<i8>::try_from(-1..99).unwrap().size(), Some(-28)); // corresponds to 100 numeration
463-
assert_eq!(Interval::<i8>::try_from(..1).unwrap().size(), Some(1)); // corresponds to 129 numeration
463+
assert_eq!(Interval::<i8>::from(..1).size(), Some(1)); // corresponds to 129 numeration
464464
assert_eq!(Interval::<i8>::from(..=1).size(), Some(2)); // corresponds to 130 numeration
465465
assert_eq!(Interval::<i8>::from(1..).size(), Some(-1)); // corresponds to 127 numeration
466466
assert_eq!(Interval::<i8>::from(0..).size(), Some(0)); // corresponds to 128 numeration
@@ -471,7 +471,7 @@ mod tests {
471471
Interval::<i8>::try_from(-1..99).unwrap().raw_size(),
472472
Some(100)
473473
);
474-
assert_eq!(Interval::<i8>::try_from(..1).unwrap().raw_size(), Some(129));
474+
assert_eq!(Interval::<i8>::from(..1).raw_size(), Some(129));
475475
assert_eq!(Interval::<i8>::from(..=1).raw_size(), Some(130));
476476
assert_eq!(Interval::<i8>::from(1..).raw_size(), Some(127));
477477
assert_eq!(Interval::<i8>::from(0..).raw_size(), Some(128));

common/src/gas_provider/property_tests/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ type Balance = u64;
9494
type Funds = u128;
9595

9696
std::thread_local! {
97-
static TOTAL_ISSUANCE: RefCell<Option<Balance>> = RefCell::new(None);
97+
static TOTAL_ISSUANCE: RefCell<Option<Balance>> = const { RefCell::new(None) };
9898
}
9999

100100
#[derive(Debug, PartialEq, Eq)]
@@ -177,7 +177,7 @@ impl<T> From<ReservationKey> for GasNodeId<T, ReservationKey> {
177177
}
178178

179179
std::thread_local! {
180-
static GAS_TREE_NODES: RefCell<BTreeMap<Key, GasNode>> = RefCell::new(BTreeMap::new());
180+
static GAS_TREE_NODES: RefCell<BTreeMap<Key, GasNode>> = const { RefCell::new(BTreeMap::new()) };
181181
}
182182

183183
struct GasTreeNodesWrap;

examples/constructor/src/builder.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ impl Calls {
4646
self
4747
}
4848

49-
// TODO #3452: remove this on next rust update
50-
#[allow(clippy::useless_conversion)]
5149
pub fn add_from_iter(mut self, calls: impl Iterator<Item = Call>) -> Self {
5250
self.0.extend(calls.into_iter());
5351
self

examples/constructor/src/wasm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ static mut SCHEME: Option<Scheme> = None;
77
fn process_fn<'a>(f: impl Fn(&'a Scheme) -> Option<&'a Vec<Call>>) {
88
let scheme = unsafe { SCHEME.as_ref() }.expect("Should be set before access");
99
let calls = f(scheme)
10-
.map(Clone::clone)
10+
.cloned()
1111
.unwrap_or_else(|| msg::load().expect("Failed to load payload"));
1212

1313
let mut res = None;

examples/fungible-token/src/wasm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ extern "C" fn state() {
170170
decimals,
171171
} = state;
172172

173-
let balances = balances.into_iter().map(|(k, v)| (k, v)).collect();
173+
let balances = balances.into_iter().collect();
174174
let allowances = allowances
175175
.into_iter()
176-
.map(|(id, allowance)| (id, allowance.into_iter().map(|(k, v)| (k, v)).collect()))
176+
.map(|(id, allowance)| (id, allowance.into_iter().collect()))
177177
.collect();
178178
let payload = IoFungibleToken {
179179
name,

examples/fungible-token/tests/benchmarks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async fn stress_test() -> Result<()> {
9292
.encode();
9393

9494
let (message_id, program_id, _hash) = api
95-
.upload_program_bytes(WASM_BINARY.to_vec(), [137u8], init_msg, MAX_GAS_LIMIT, 0)
95+
.upload_program_bytes(WASM_BINARY, [137u8], init_msg, MAX_GAS_LIMIT, 0)
9696
.await?;
9797

9898
assert!(listener.message_processed(message_id).await?.succeed());
@@ -229,7 +229,7 @@ async fn stress_transfer() -> Result<()> {
229229

230230
let salt: u8 = rng.gen();
231231
let (message_id, program_id, _hash) = api
232-
.upload_program_bytes(WASM_BINARY.to_vec(), [salt], init_msg, MAX_GAS_LIMIT, 0)
232+
.upload_program_bytes(WASM_BINARY, [salt], init_msg, MAX_GAS_LIMIT, 0)
233233
.await
234234
.unwrap();
235235

examples/new-meta/src/wasm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" fn handle() {
2727
let res = unsafe { &WALLETS }
2828
.iter()
2929
.find(|w| w.id.decimal == message_in.id.decimal)
30-
.map(Clone::clone);
30+
.cloned();
3131

3232
let message_out = MessageOut { res };
3333

examples/node/src/wasm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fn process(request: Request) -> Reply {
143143
transition.query_list = state().sub_nodes.iter().cloned().collect();
144144
let first_sub_node = *transition
145145
.query_list
146-
.get(0)
146+
.first()
147147
.expect("Checked above that sub_nodes is not empty; qed");
148148
transition.last_sent_message_id =
149149
msg::send(first_sub_node, request, 0).unwrap();
@@ -176,7 +176,7 @@ fn process(request: Request) -> Reply {
176176
if let TransitionState::Ready = transition.state {
177177
let first_sub_node = *transition
178178
.query_list
179-
.get(0)
179+
.first()
180180
.expect("Checked above that sub_nodes is not empty; qed");
181181

182182
transition.query_index = 0;

gcli/tests/common/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,12 @@
1717
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

1919
//! Common utils for integration tests
20-
pub use self::{
21-
args::Args,
22-
node::{Convert, NodeExec},
23-
result::{Error, Result},
24-
};
20+
pub use self::{args::Args, node::NodeExec, result::Result};
2521
use gear_core::ids::{CodeId, ProgramId};
2622
use gsdk::{
2723
ext::{sp_core::crypto::Ss58Codec, sp_runtime::AccountId32},
2824
testing::Node,
2925
};
30-
pub use scale_info::scale::Encode;
3126
use std::{
3227
iter::IntoIterator,
3328
process::{Command, Output},

gclient/src/api/listener/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ mod subscription;
2121

2222
pub use gsdk::metadata::{gear::Event as GearEvent, Event};
2323
pub use iterator::*;
24-
pub use subscription::*;
2524

2625
use crate::{Error, Result};
2726
use async_trait::async_trait;

0 commit comments

Comments
 (0)