Skip to content

Commit

Permalink
feat: use const fn where possible
Browse files Browse the repository at this point in the history
this just enables the use of the function inside other const contexts.
one potential caveat to consider is if you ever need to make this
method non-const in future, it's a breaking change.
that seems unlikely in this case, but it's worth bearing in mind.

suggested by clippy's `missing_const_for_fn` lint:
https://rust-lang.github.io/rust-clippy/master/index.html#/missing_const_for_fn
  • Loading branch information
backwardspy authored and sgoudham committed Oct 20, 2023
1 parent 2ad8afe commit 93a4b6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ impl OfficeHours {
/// }
/// ```
#[must_use]
pub fn iter(&self) -> OfficeHoursIter {
pub const fn iter(&self) -> OfficeHoursIter {
OfficeHoursIter {
start: self.start,
finish: self.finish,
Expand Down

0 comments on commit 93a4b6f

Please sign in to comment.