diff --git a/src/types/request.rs b/src/types/request.rs index d1712af..54988f5 100644 --- a/src/types/request.rs +++ b/src/types/request.rs @@ -247,7 +247,8 @@ impl Request { let Some(ref target) = self.target else { return Err(BuildError::NoTarget); }; - Ok(self.attach_all(target)) + let target = target.clone(); + Ok(self.attach_all(&target)) } /// Attach all capabilities we have that were issued by `target` to the next message. pub fn attach_all(mut self, target: &Address) -> Self { diff --git a/src/types/response.rs b/src/types/response.rs index 40706b9..fe8a035 100644 --- a/src/types/response.rs +++ b/src/types/response.rs @@ -150,13 +150,6 @@ impl Response { self.capabilities = capabilities; self } - /// Attach all capabilities we have that were issued by `target` (if set) to the next message. - pub fn try_attach_all(mut self) -> Result { - let Some(ref target) = self.target else { - return Err(BuildError::NoTarget); - }; - Ok(self.attach_all(target)) - } /// Attach all capabilities we have that were issued by `target` to the next message. pub fn attach_all(mut self, target: &Address) -> Self { let target = target.clone();