Skip to content

Commit 2776826

Browse files
Implement protobuf feature specific From conversion between &Arc<Entity> and proto::Entity
1 parent c88b1a3 commit 2776826

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cedar-policy-core/src/ast/entity.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,13 @@ impl From<&Entity> for proto::Entity {
773773
}
774774
}
775775

776+
#[cfg(feature = "protobufs")]
777+
impl From<&Arc<Entity>> for proto::Entity {
778+
fn from(v: &Arc<Entity>) -> Self {
779+
Self::from(v.as_ref())
780+
}
781+
}
782+
776783
/// `PartialValue`, but serialized as a `RestrictedExpr`.
777784
///
778785
/// (Extension values can't be directly serialized, but can be serialized as

0 commit comments

Comments
 (0)