Skip to content

Commit

Permalink
More idiomatic return types for metadata getters (#2398)
Browse files Browse the repository at this point in the history
* More idiomatic return types for metadata getters

* Update changelog
  • Loading branch information
davidsemakula authored Feb 11, 2025
1 parent 31dfd7d commit 39157b3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Changed
- Restrict which `cfg` attributes can be used ‒ [#2313](https://github.com/use-ink/ink/pull/2313)
- More idiomatic return types for metadata getters - [#2398](https://github.com/use-ink/ink/pull/2398)

## Added
- Add feature flag to compile contracts for `pallet-revive`[#2318](https://github.com/use-ink/ink/pull/2318)
Expand Down
4 changes: 2 additions & 2 deletions crates/metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ impl InkProject {
}

/// Returns the metadata version used by the contract.
pub fn version(&self) -> &u64 {
&self.version
pub fn version(&self) -> u64 {
self.version
}

/// Returns a read-only registry of types in the contract.
Expand Down
12 changes: 6 additions & 6 deletions crates/metadata/src/specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ where
}

/// Returns if the constructor is payable by the caller.
pub fn payable(&self) -> &bool {
&self.payable
pub fn payable(&self) -> bool {
self.payable
}

/// Returns the parameters of the deployment handler.
Expand All @@ -450,8 +450,8 @@ where
&self.docs
}

pub fn default(&self) -> &bool {
&self.default
pub fn default(&self) -> bool {
self.default
}
}

Expand Down Expand Up @@ -743,8 +743,8 @@ where
&self.docs
}

pub fn default(&self) -> &bool {
&self.default
pub fn default(&self) -> bool {
self.default
}
}

Expand Down

0 comments on commit 39157b3

Please sign in to comment.