Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions patchable-macro/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,19 @@ impl<'a> FieldAction<'a> {
}
}

fn member(&self) -> &FieldMember<'a> {
const fn member(&self) -> &FieldMember<'a> {
match self {
FieldAction::Keep { member, .. } | FieldAction::Patch { member, .. } => member,
}
}

fn ty(&self) -> &'a Type {
const fn ty(&self) -> &'a Type {
match self {
FieldAction::Keep { ty, .. } | FieldAction::Patch { ty, .. } => ty,
}
}

fn is_patch(&self) -> bool {
const fn is_patch(&self) -> bool {
matches!(self, FieldAction::Patch { .. })
}

Expand Down
2 changes: 1 addition & 1 deletion patchable/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use patchable::patchable_model;
use serde::{Deserialize, Serialize};

pub fn identity(x: &i32) -> i32 {
pub const fn identity(x: &i32) -> i32 {
*x
}

Expand Down
2 changes: 1 addition & 1 deletion patchable/tests/no_serde.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use patchable::patchable_model;

fn plus_one(x: i32) -> i32 {
const fn plus_one(x: i32) -> i32 {
x + 1
}

Expand Down