Skip to content

Commit

Permalink
Make new_unchecked function const
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Feb 20, 2024
1 parent c8e3f72 commit e9f2538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nutype_macros/src/common/gen/new_unchecked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn gen_new_unchecked(
/// Creates a value of type skipping the sanitization and validation
/// rules. Generally, you should avoid using `::new_unchecked()` without a real need.
/// Use `::new()` instead when it's possible.
pub unsafe fn new_unchecked(inner_value: #inner_type) -> #type_name {
pub const unsafe fn new_unchecked(inner_value: #inner_type) -> #type_name {
#type_name(inner_value)
}
}
Expand Down

0 comments on commit e9f2538

Please sign in to comment.