From 7ac216f3a9698bffebab285a5ae68f3a374a383e Mon Sep 17 00:00:00 2001 From: Michael Macias Date: Fri, 6 Oct 2023 19:08:00 -0500 Subject: [PATCH] sam/record/cigar/op: Make new const --- noodles-sam/CHANGELOG.md | 2 ++ noodles-sam/src/record/cigar/op.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/noodles-sam/CHANGELOG.md b/noodles-sam/CHANGELOG.md index 7c9dc4b84..50197c2ee 100644 --- a/noodles-sam/CHANGELOG.md +++ b/noodles-sam/CHANGELOG.md @@ -6,6 +6,8 @@ * sam/lazy/record: Return raw read name (`lazy::Record::read_name`). + * sam/record/cigar/op: Make `Op::new` `const`. + ## 0.43.0 - 2023-09-21 ### Added diff --git a/noodles-sam/src/record/cigar/op.rs b/noodles-sam/src/record/cigar/op.rs index 0cb2064c1..4984150f8 100644 --- a/noodles-sam/src/record/cigar/op.rs +++ b/noodles-sam/src/record/cigar/op.rs @@ -26,7 +26,7 @@ impl Op { /// assert_eq!(op.kind(), Kind::Match); /// assert_eq!(op.len(), 13); /// ``` - pub fn new(kind: Kind, len: usize) -> Self { + pub const fn new(kind: Kind, len: usize) -> Self { Self { kind, len } }