Skip to content

Commit

Permalink
chore: use resolver 2 and 2021 edition (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevoronov authored Dec 18, 2023
1 parent 771d42d commit 0a8827b
Show file tree
Hide file tree
Showing 39 changed files with 38 additions and 56 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"air",
"air-interpreter",
Expand Down
2 changes: 1 addition & 1 deletion air-interpreter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-interpreter"
version = "0.55.0"
description = "Crate-wrapper for air"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
publish = false
keywords = ["fluence", "air", "webassembly", "programming-language"]
categories = ["wasm"]
Expand Down
2 changes: 1 addition & 1 deletion air/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aquavm-air"
version = "0.55.0"
description = "Interpreter of AIR scripts intended to coordinate request flow in the Fluence network"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/fluencelabs/aquavm"
documentation = "https://docs.rs/aquavm-air"
Expand Down
1 change: 0 additions & 1 deletion air/src/execution_step/lambda_applier/applier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use air_lambda_parser::ValueAccessor;
use non_empty_vec::NonEmpty;

use std::borrow::Cow;
use std::convert::TryFrom;
use std::ops::Deref;
use std::rc::Rc;

Expand Down
2 changes: 0 additions & 2 deletions air/src/execution_step/lambda_applier/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ fn try_jvalue_as_idx(jvalue: &JValue) -> LambdaResult<u32> {
}

fn try_number_to_u32(accessor: &serde_json::Number) -> LambdaResult<u32> {
use std::convert::TryFrom;

accessor
.as_u64()
.and_then(|v| u32::try_from(v).ok())
Expand Down
1 change: 0 additions & 1 deletion air/src/execution_step/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ pub use lambda_applier::LambdaError;

pub mod errors_prelude {
pub use super::CatchableError;
pub use super::ExecutionError;
pub use super::UncatchableError;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,13 @@ pub enum Generation {
impl Generation {
#[cfg(test)]
pub fn previous(generation_id: u32) -> Self {
use std::convert::TryFrom;

let generation_id = usize::try_from(generation_id).unwrap();
let generation_idx = GenerationIdx::from(generation_id);
Self::Previous(generation_idx)
}

#[cfg(test)]
pub fn current(generation_id: u32) -> Self {
use std::convert::TryFrom;

let generation_id = usize::try_from(generation_id).unwrap();
let generation_idx = GenerationIdx::from(generation_id);
Self::Current(generation_idx)
Expand Down
3 changes: 3 additions & 0 deletions air/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ pub use execution_step::execution_context::no_error;
pub use execution_step::execution_context::no_error_object;
pub use execution_step::execution_context::ExecutionCidState;
pub use execution_step::execution_context::InstructionError;
pub use execution_step::execution_context::ERROR_CODE_FIELD_NAME;
pub use execution_step::execution_context::INSTRUCTION_FIELD_NAME;
pub use execution_step::execution_context::MESSAGE_FIELD_NAME;
pub use execution_step::execution_context::NO_ERROR_ERROR_CODE;
pub use execution_step::execution_context::NO_ERROR_MESSAGE;
pub use execution_step::CatchableError;
Expand Down
2 changes: 0 additions & 2 deletions air/src/preparation_step/preparation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ use air_parser::ast::Instruction;
use air_utils::measure;
use fluence_keypair::KeyFormat;

use std::convert::TryFrom;

type PreparationResult<T> = Result<T, PreparationError>;

/// Represents result of the preparation_step step.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "auth_module"
version = "0.1.0"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"

[[bin]]
name = "auth_module"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "log_storage"
version = "0.1.0"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"

[[bin]]
name = "log_storage"
Expand Down
2 changes: 1 addition & 1 deletion air/tests/test_module/issues/issue_178.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn par_ap_behaviour() {
let client_result_1 = engine.execute_one(client_name).unwrap();
assert_next_pks!(
&client_result_1.next_peer_pks,
[relay_id.as_str(), variable_setter_id.as_str()]
&[relay_id.as_str(), variable_setter_id.as_str()]
);

let setter_result = engine.execute_one(variable_setter_name).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion avm/interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "avm-interface"
description = "Fluence AIR VM interfacing"
version = "0.29.3"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
documentation = "https://docs.rs/avm-interface"
repository = "https://github.com/fluencelabs/aquavm/tree/master/avm/interface"
Expand Down
2 changes: 1 addition & 1 deletion avm/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "avm-server"
description = "Fluence AIR VM"
version = "0.33.4"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
documentation = "https://docs.rs/avm-server"
repository = "https://github.com/fluencelabs/aquavm/tree/master/avm/server"
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/air-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "aquavm-air-parser"
description = "Parser of the AIR scripts in a form of string to AST"
version = "0.11.0"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
documentation = "https://docs.rs/air-parser"
repository = "https://github.com/fluencelabs/aquavm"
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/execution-info-collector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-execution-info-collector"
version = "0.7.11"
description = "Implementation of AIR execution info collector"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/fluencelabs/aquavm"
documentation = "https://docs.rs/air-execution-info-collector"
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/interpreter-cid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-interpreter-cid"
description = "AIR interpreter CID util module"
version = "0.7.0"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
documentation = "https://docs.rs/air-interpreter-cid"
repository = "https://github.com/fluencelabs/aquavm/tree/master/crates/air-lib/interpreter-cid"
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/interpreter-data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-interpreter-data"
description = "Data format of the AIR interpreter"
version = "0.15.0"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/fluencelabs/aquavm"
documentation = "https://docs.rs/air-interpreter-data"
Expand Down
2 changes: 0 additions & 2 deletions crates/air-lib/interpreter-data/src/trace_pos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ use newtype_derive::*;
use serde::Deserialize;
use serde::Serialize;

use std::convert::TryFrom;

pub type PosType = u32;

#[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/interpreter-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-interpreter-interface"
description = "Interface of the AIR interpreter"
version = "0.15.2"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
documentation = "https://docs.rs/air-interpreter-interface"
repository = "https://github.com/fluencelabs/aquavm/tree/master/crates/air-lib/interpreter-interface"
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/interpreter-signatures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-interpreter-signatures"
description = "AIR interpreter signatures util module"
version = "0.1.5"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
documentation = "https://docs.rs/air-interpreter-signatures"
repository = "https://github.com/fluencelabs/aquavm/tree/master/crates/air-lib/interpreter-signatures"
Expand Down
1 change: 0 additions & 1 deletion crates/air-lib/interpreter-signatures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ use borsh::BorshSerialize;
use fluence_keypair::error::SigningError;
use serde::{Deserialize, Serialize};

use std::convert::TryFrom;
use std::hash::Hash;
use std::ops::Deref;

Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/lambda/ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-lambda-ast"
description = "Definition of the AIR lambda AST"
version = "0.1.0"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/fluencelabs/aquavm"
documentation = "https://docs.rs/air-lambda-ast"
Expand Down
2 changes: 0 additions & 2 deletions crates/air-lib/lambda/ast/src/ast/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ use crate::ValueAccessor;
pub use non_empty_vec::EmptyError;
use non_empty_vec::NonEmpty;

use std::convert::TryFrom;

impl<'input> LambdaAST<'input> {
pub fn try_from_accessors(accessors: Vec<ValueAccessor<'input>>) -> Result<Self, EmptyError> {
let value_path = NonEmpty::try_from(accessors)?;
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/lambda/parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-lambda-parser"
description = "Parser of an AIR lambda"
version = "0.1.0"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/fluencelabs/aquavm"
documentation = "https://docs.rs/air-lambda-parser"
Expand Down
3 changes: 0 additions & 3 deletions crates/air-lib/lambda/parser/src/parser/lambda_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ use crate::Functor;
use crate::LambdaAST;
use crate::ValueAccessor;

use std::convert::TryFrom;
use std::convert::TryInto;

// Caching parser to cache internal regexes, which are expensive to instantiate
// See also https://github.com/lalrpop/lalrpop/issues/269
thread_local!(static PARSER: RawLambdaASTParser = RawLambdaASTParser::new());
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/log-targets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-log-targets"
version = "0.1.0"
description = "Definition of global consts used for logging"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/fluencelabs/aquavm"
documentation = "https://docs.rs/air-log-targets"
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/polyplets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "polyplets"
version = "0.5.1"
description = "Security primitives to verify origin of service calls in Fluence network"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
documentation = "https://docs.rs/polyplets"
repository = "https://github.com/fluencelabs/aquavm/tree/master/crates/air-lib/polyplets"
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-test-utils"
version = "0.13.0"
description = "Test utils for the AIR interpreter"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/fluencelabs/aquavm"
documentation = "https://docs.rs/air-test-utils"
Expand Down
1 change: 0 additions & 1 deletion crates/air-lib/test-utils/src/key_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use rand_chacha::rand_core::SeedableRng;
// Should be moved to test lib when keypair interface PR is merged.
pub fn derive_dummy_keypair(seed: &str) -> (KeyPair, String) {
use sha2::{Digest as _, Sha256};
use std::convert::TryFrom;

let mut rng = {
let mut hasher = Sha256::new();
Expand Down
5 changes: 1 addition & 4 deletions crates/air-lib/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ pub mod prelude {
pub use executed_state::*;
pub use test_runner::*;

pub use air::interpreter_data::*;
pub use avm_server::*;

pub use serde_json::json;
}

Expand Down Expand Up @@ -132,7 +129,7 @@ macro_rules! assert_next_pks {
($expected:expr, $actual:expr) => {
let expected: std::collections::HashSet<_> =
$expected.into_iter().map(|s| s.as_str()).collect();
let actual: std::collections::HashSet<_> = $actual.into_iter().map(|s| *s).collect();
let actual: std::collections::HashSet<_> = $actual.iter().map(|s| *s).collect();

assert_eq!(expected, actual)
};
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/trace-handler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-trace-handler"
version = "0.5.8"
description = "Implementation of AIR trace handler"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
keywords = ["fluence", "air", "webassembly", "programming-language"]
categories = ["wasm"]
Expand Down
2 changes: 1 addition & 1 deletion crates/air-lib/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-utils"
version = "0.2.0"
description = "AIR helper funcitions and macros"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
keywords = ["fluence", "air", "webassembly", "programming-language"]
categories = ["wasm"]
Expand Down
2 changes: 1 addition & 1 deletion crates/beautifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "air-beautifier"
version = "0.4.0"
description = "AIR human-readable format transformer library"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/fluencelabs/aquavm"
documentation = "https://docs.rs/air-beautifier"
Expand Down
2 changes: 1 addition & 1 deletion crates/data-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "avm-data-store"
version = "0.7.3"
description = "Definition of the AVM DataStore trait"
authors = ["Fluence Labs"]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
documentation = "https://docs.rs/avm-data-store"
repository = "https://github.com/fluencelabs/aquavm/tree/master/crates/data-store"
Expand Down
Loading

0 comments on commit 0a8827b

Please sign in to comment.