Skip to content

Commit 39157b3

Browse files
More idiomatic return types for metadata getters (use-ink#2398)
* More idiomatic return types for metadata getters * Update changelog
1 parent 31dfd7d commit 39157b3

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

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

1415
## Added
1516
- Add feature flag to compile contracts for `pallet-revive`[#2318](https://github.com/use-ink/ink/pull/2318)

crates/metadata/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ impl InkProject {
123123
}
124124

125125
/// Returns the metadata version used by the contract.
126-
pub fn version(&self) -> &u64 {
127-
&self.version
126+
pub fn version(&self) -> u64 {
127+
self.version
128128
}
129129

130130
/// Returns a read-only registry of types in the contract.

crates/metadata/src/specs.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ where
431431
}
432432

433433
/// Returns if the constructor is payable by the caller.
434-
pub fn payable(&self) -> &bool {
435-
&self.payable
434+
pub fn payable(&self) -> bool {
435+
self.payable
436436
}
437437

438438
/// Returns the parameters of the deployment handler.
@@ -450,8 +450,8 @@ where
450450
&self.docs
451451
}
452452

453-
pub fn default(&self) -> &bool {
454-
&self.default
453+
pub fn default(&self) -> bool {
454+
self.default
455455
}
456456
}
457457

@@ -743,8 +743,8 @@ where
743743
&self.docs
744744
}
745745

746-
pub fn default(&self) -> &bool {
747-
&self.default
746+
pub fn default(&self) -> bool {
747+
self.default
748748
}
749749
}
750750

0 commit comments

Comments
 (0)