Skip to content

Commit 0666d2c

Browse files
authored
fix try_attach_all() method (#121)
* fix `try_attach_all()` method * fix `try_attach_all()` method again * fix `try_attach_all()` method again**2 * fix `try_attach_all()` method again**3 * fix `try_attach_all()` method again**4
1 parent 2aac31a commit 0666d2c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/types/request.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ impl Request {
247247
let Some(ref target) = self.target else {
248248
return Err(BuildError::NoTarget);
249249
};
250-
Ok(self.attach_all(target))
250+
let target = target.clone();
251+
Ok(self.attach_all(&target))
251252
}
252253
/// Attach all capabilities we have that were issued by `target` to the next message.
253254
pub fn attach_all(mut self, target: &Address) -> Self {

src/types/response.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,6 @@ impl Response {
150150
self.capabilities = capabilities;
151151
self
152152
}
153-
/// Attach all capabilities we have that were issued by `target` (if set) to the next message.
154-
pub fn try_attach_all(mut self) -> Result<Self, BuildError> {
155-
let Some(ref target) = self.target else {
156-
return Err(BuildError::NoTarget);
157-
};
158-
Ok(self.attach_all(target))
159-
}
160153
/// Attach all capabilities we have that were issued by `target` to the next message.
161154
pub fn attach_all(mut self, target: &Address) -> Self {
162155
let target = target.clone();

0 commit comments

Comments
 (0)