Skip to content

Commit

Permalink
Rename Mapping::put to Mapping::set
Browse files Browse the repository at this point in the history
  • Loading branch information
d0cd committed Apr 18, 2023
1 parent aeab0c5 commit da75373
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions compiler/ast/src/functions/core_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum CoreFunction {

MappingGet,
MappingGetOr,
MappingPut,
MappingSet,
}

impl CoreFunction {
Expand All @@ -66,7 +66,7 @@ impl CoreFunction {

(sym::Mapping, sym::get) => Self::MappingGet,
(sym::Mapping, sym::get_or) => Self::MappingGetOr,
(sym::Mapping, sym::put) => Self::MappingPut,
(sym::Mapping, sym::set) => Self::MappingSet,
_ => return None,
})
}
Expand Down Expand Up @@ -94,7 +94,7 @@ impl CoreFunction {

Self::MappingGet => 2,
Self::MappingGetOr => 3,
Self::MappingPut => 3,
Self::MappingSet => 3,
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl ExpressionReconstructor for DeadCodeEliminator {
match (&function.ty, function.name.name) {
(Type::Identifier(Identifier { name: sym::Mapping, .. }), sym::get)
| (Type::Identifier(Identifier { name: sym::Mapping, .. }), sym::get_or)
| (Type::Identifier(Identifier { name: sym::Mapping, .. }), sym::put) => {
| (Type::Identifier(Identifier { name: sym::Mapping, .. }), sym::set) => {
self.is_necessary = true;
}
_ => {}
Expand Down
2 changes: 1 addition & 1 deletion compiler/passes/src/type_checking/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ impl<'a> TypeChecker<'a> {
None
}
}
CoreFunction::MappingPut => {
CoreFunction::MappingSet => {
// Check that the operation is invoked in a `finalize` block.
if !self.is_finalize {
self.handler
Expand Down
2 changes: 1 addition & 1 deletion compiler/span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ symbols! {
get,
get_or,
hash,
put,
Mapping,
Pedersen64,
Pedersen128,
Poseidon2,
Poseidon4,
Poseidon8,
set,

// types
address,
Expand Down

0 comments on commit da75373

Please sign in to comment.