radicle: Fix clippy::result_large_err

After upgrading from Rust 1.85 to 1.88 in 586eefc, clippy started
warning about large error types. Box action to make
`radicle::cob::patch::Error` lighter.
This commit is contained in:
Lorenz Leutgeb 2025-07-25 11:25:50 +02:00
parent 5bab3f9cc0
commit fdb1ac4e3a
1 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ pub enum Error {
Op(#[from] op::OpEncodingError), Op(#[from] op::OpEncodingError),
/// Action not authorized by the author /// Action not authorized by the author
#[error("{0} not authorized to apply {1:?}")] #[error("{0} not authorized to apply {1:?}")]
NotAuthorized(ActorId, Action), NotAuthorized(ActorId, Box<Action>),
/// An illegal action. /// An illegal action.
#[error("action is not allowed: {0}")] #[error("action is not allowed: {0}")]
NotAllowed(EntryId), NotAllowed(EntryId),
@ -783,7 +783,7 @@ impl Patch {
Authorization::Allow => { Authorization::Allow => {
self.action(action, id, author, timestamp, concurrent, doc, repo) self.action(action, id, author, timestamp, concurrent, doc, repo)
} }
Authorization::Deny => Err(Error::NotAuthorized(author, action)), Authorization::Deny => Err(Error::NotAuthorized(author, Box::new(action))),
Authorization::Unknown => { Authorization::Unknown => {
// In this case, since there is not enough information to determine // In this case, since there is not enough information to determine
// whether the action is authorized or not, we simply ignore it. // whether the action is authorized or not, we simply ignore it.
@ -1228,7 +1228,7 @@ impl store::Cob for Patch {
patch.action(action, op.id, op.author, op.timestamp, &[], &doc, repo)?; patch.action(action, op.id, op.author, op.timestamp, &[], &doc, repo)?;
} }
Authorization::Deny => { Authorization::Deny => {
return Err(Error::NotAuthorized(op.author, action)); return Err(Error::NotAuthorized(op.author, Box::new(action)));
} }
Authorization::Unknown => { Authorization::Unknown => {
// Note that this shouldn't really happen since there's no concurrency in the // Note that this shouldn't really happen since there's no concurrency in the