From 93a4b6f233a28bc07a7d7ebfe1df1dd2ccafd9d8 Mon Sep 17 00:00:00 2001 From: backwardspy Date: Fri, 20 Oct 2023 14:07:29 +0100 Subject: [PATCH] feat: use const fn where possible 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 --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 4c552e1..bfcca33 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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,