Skip to content

Commit

Permalink
Fix warnings (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeed-zil authored Jan 10, 2024
1 parent 5d23540 commit 1547779
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[env]
CONTRACTS_PATH = {value = "tests/contrats", relative = true}
CONTRACTS_PATH = {value = "tests/contracts", relative = true}
11 changes: 8 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn transition_to_rust_function(transition: &Transition) -> String {
let transition_name_snake = transition.name.to_case(convert_case::Case::Snake);
format!(
r#"
pub fn {transition_name_snake}(&self {}) -> RefMut<'_, transition_call::TransitionCall<T>> {{
pub fn {transition_name_snake}(&self {}) -> core::cell::RefMut<'_, transition_call::TransitionCall<T>> {{
self.{transition_name_snake}.borrow_mut().args(vec![{}]);
self.{transition_name_snake}.borrow_mut()
}}
Expand Down Expand Up @@ -103,7 +103,12 @@ fn field_to_function_param(field: &Field) -> String {
fn transitions_as_struct_fields(transitions: &Vec<Transition>) -> String {
transitions
.iter()
.map(|tr| format!("{}: RefCell<TransitionCall<T>>,", tr.name.to_case(convert_case::Case::Snake)))
.map(|tr| {
format!(
"{}: core::cell::RefCell<TransitionCall<T>>,",
tr.name.to_case(convert_case::Case::Snake)
)
})
.reduce(|acc, e| format!("{acc}\n {e}"))
.unwrap_or_default()
}
Expand Down Expand Up @@ -140,7 +145,7 @@ fn transitions_to_transition_call_object(transitions: &Vec<Transition>) -> Strin
.iter()
.map(|tr| {
format!(
"{}: RefCell::new(TransitionCall::new(\"{}\", &base.address, base.client.clone())),",
"{}: core::cell::RefCell::new(TransitionCall::new(\"{}\", &base.address, base.client.clone())),",
tr.name.to_case(convert_case::Case::Snake),
tr.name
)
Expand Down
1 change: 0 additions & 1 deletion src/contract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@
pub mod factory;
pub mod scilla_value;
pub mod transition_call;
use core::cell::{RefCell, RefMut};
use std::{ops::Deref, str::FromStr, sync::Arc};

pub use factory::Factory as ContractFactory;
Expand Down

0 comments on commit 1547779

Please sign in to comment.