casper-network / casper-network/casper-node

Change methods to `const` where appropriate

Open
#1,523 3 comments 0 reactions 0 assignees View on GitHub
good first issue tech-debt
Dominant language
Rust
Stars
399
Forks
224
Avg merge
15h 44m
Merged PRs (30d)
2

Description

We should do a pass of the codebase looking for opportunities to change methods to `const`. For example, [`impl Weight`](https://github.com/casper-network/casper-node/blob/dev/types/src/account.rs#L176-L186) should be changed to:

```rust
impl Weight {
/// Constructs a new `Weight`.
pub const fn new(weight: u8) -> Weight {
Weight(weight)
}

/// Returns the value of `self` as a `u8`.
pub const fn value(self) -> u8 {
self.0
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.