Skip to content

Commit 4a41755

Browse files
authored
chore: upgrade rust to 1.86.0 and fix new clippy lints (Templar-Protocol#312)
1 parent 5966061 commit 4a41755

File tree

21 files changed

+45
-38
lines changed

21 files changed

+45
-38
lines changed

.github/actions/rust/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ runs:
1313
using: composite
1414
steps:
1515
- name: Install Rust toolchain
16-
uses: dtolnay/rust-toolchain@1.85.0
16+
uses: dtolnay/rust-toolchain@1.86.0
1717
with:
1818
targets: ${{ inputs.targets }}
1919
components: ${{ inputs.components }}

.github/workflows/undeploy-staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
rpc_api_key: "${{ secrets.NEAR_CONTRACT_STAGING_RPC_API_KEY }}"
5858

5959
- name: Install Rust toolchain
60-
uses: dtolnay/rust-toolchain@1.85.0
60+
uses: dtolnay/rust-toolchain@1.86.0
6161

6262
- uses: actions/cache@v4
6363
with:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
resolver = "2"
2+
resolver = "3"
33
members = [
44
"common",
55
"contract/*",

common/src/borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ impl<'a> BorrowPositionGuard<'a> {
720720
///
721721
/// - If this record is not eligible for liquidation.
722722
/// - If the liquidator requests to liquidate too much collateral from the
723-
/// position.
723+
/// position.
724724
/// - If the calculation of the collateral value fails.
725725
/// - If the liquidator offers too little to purchase the collateral.
726726
pub fn record_liquidation_initial(

common/src/vault.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub trait VaultExt {
164164
// Add a 20% buffer to a gas estimate
165165
#[must_use]
166166
pub const fn buffer(size: u64) -> Gas {
167-
Gas::from_tgas((size * 6 + 4) / 5)
167+
Gas::from_tgas((size * 6).div_ceil(5))
168168
}
169169

170170
// Fetching a position

contract/lst-oracle/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ crate-type = ["cdylib", "rlib"]
1212
# in https://github.com/near/NEPs/blob/master/neps/nep-0330.md
1313
[package.metadata.near.reproducible_build]
1414
# docker image, descriptor of build environment
15-
image = "sourcescan/cargo-near:0.13.4-rust-1.85.0"
15+
image = "sourcescan/cargo-near:0.17.0-rust-1.86.0"
1616
# tag after colon above serves only descriptive purpose; image is identified by digest
17-
image_digest = "sha256:a9d8bee7b134856cc8baa142494a177f2ba9ecfededfcdd38f634e14cca8aae2"
17+
image_digest = "sha256:1784ca6310f3496f0048356ce420921c8f5fdf71ee8124d43a2e1ceb1f70db8a"
1818
# build command inside of docker container
1919
# if docker image from default gallery is used https://hub.docker.com/r/sourcescan/cargo-near/tags,
2020
# the command may be any combination of flags of `cargo-near`,

contract/market/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ crate-type = ["cdylib", "rlib"]
1212
# in https://github.com/near/NEPs/blob/master/neps/nep-0330.md
1313
[package.metadata.near.reproducible_build]
1414
# docker image, descriptor of build environment
15-
image = "sourcescan/cargo-near:0.13.4-rust-1.85.0"
15+
image = "sourcescan/cargo-near:0.17.0-rust-1.86.0"
1616
# tag after colon above serves only descriptive purpose; image is identified by digest
17-
image_digest = "sha256:a9d8bee7b134856cc8baa142494a177f2ba9ecfededfcdd38f634e14cca8aae2"
17+
image_digest = "sha256:1784ca6310f3496f0048356ce420921c8f5fdf71ee8124d43a2e1ceb1f70db8a"
1818
# build command inside of docker container
1919
# if docker image from default gallery is used https://hub.docker.com/r/sourcescan/cargo-near/tags,
2020
# the command may be any combination of flags of `cargo-near`,

contract/market/src/impl_market_external.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ impl MarketExternalInterface for Contract {
233233
WithdrawalAttempt::EmptyPosition => {
234234
self.withdrawal_queue.pop();
235235
depth_cleared += requested_amount;
236-
continue;
237236
}
238237
WithdrawalAttempt::NoLiquidity => {
239238
break;

contract/registry/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ crate-type = ["cdylib", "rlib"]
1212
# in https://github.com/near/NEPs/blob/master/neps/nep-0330.md
1313
[package.metadata.near.reproducible_build]
1414
# docker image, descriptor of build environment
15-
image = "sourcescan/cargo-near:0.13.4-rust-1.85.0"
15+
image = "sourcescan/cargo-near:0.17.0-rust-1.86.0"
1616
# tag after colon above serves only descriptive purpose; image is identified by digest
17-
image_digest = "sha256:a9d8bee7b134856cc8baa142494a177f2ba9ecfededfcdd38f634e14cca8aae2"
17+
image_digest = "sha256:1784ca6310f3496f0048356ce420921c8f5fdf71ee8124d43a2e1ceb1f70db8a"
1818
# build command inside of docker container
1919
# if docker image from default gallery is used https://hub.docker.com/r/sourcescan/cargo-near/tags,
2020
# the command may be any combination of flags of `cargo-near`,

contract/universal-account/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ crate-type = ["cdylib", "rlib"]
1212
# in https://github.com/near/NEPs/blob/master/neps/nep-0330.md
1313
[package.metadata.near.reproducible_build]
1414
# docker image, descriptor of build environment
15-
image = "sourcescan/cargo-near:0.13.4-rust-1.85.0"
15+
image = "sourcescan/cargo-near:0.17.0-rust-1.86.0"
1616
# tag after colon above serves only descriptive purpose; image is identified by digest
17-
image_digest = "sha256:a9d8bee7b134856cc8baa142494a177f2ba9ecfededfcdd38f634e14cca8aae2"
17+
image_digest = "sha256:1784ca6310f3496f0048356ce420921c8f5fdf71ee8124d43a2e1ceb1f70db8a"
1818
# build command inside of docker container
1919
# if docker image from default gallery is used https://hub.docker.com/r/sourcescan/cargo-near/tags,
2020
# the command may be any combination of flags of `cargo-near`,

0 commit comments

Comments
 (0)