From e78097bf24d5a49cb9ff6d96eaec2e57bf94e6cb Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Tue, 10 Dec 2024 11:34:58 -0800 Subject: [PATCH 1/5] fix `try_attach_all()` method --- src/types/request.rs | 2 +- src/types/response.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/request.rs b/src/types/request.rs index d1712af..8e10f99 100644 --- a/src/types/request.rs +++ b/src/types/request.rs @@ -247,7 +247,7 @@ impl Request { let Some(ref target) = self.target else { return Err(BuildError::NoTarget); }; - Ok(self.attach_all(target)) + Ok(self.attach_all(target.clone())) } /// 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..41ca30e 100644 --- a/src/types/response.rs +++ b/src/types/response.rs @@ -155,7 +155,7 @@ impl Response { let Some(ref target) = self.target else { return Err(BuildError::NoTarget); }; - Ok(self.attach_all(target)) + Ok(self.attach_all(target.clone())) } /// Attach all capabilities we have that were issued by `target` to the next message. pub fn attach_all(mut self, target: &Address) -> Self { From bc7f0dd1b6472bdcfe3f6fb3e07479194ed85cf8 Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Tue, 10 Dec 2024 11:38:32 -0800 Subject: [PATCH 2/5] fix `try_attach_all()` method again --- src/types/request.rs | 2 +- src/types/response.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/request.rs b/src/types/request.rs index 8e10f99..2de1322 100644 --- a/src/types/request.rs +++ b/src/types/request.rs @@ -247,7 +247,7 @@ impl Request { let Some(ref target) = self.target else { return Err(BuildError::NoTarget); }; - Ok(self.attach_all(target.clone())) + Ok(self.attach_all(&target.clone())) } /// 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 41ca30e..e371244 100644 --- a/src/types/response.rs +++ b/src/types/response.rs @@ -155,7 +155,7 @@ impl Response { let Some(ref target) = self.target else { return Err(BuildError::NoTarget); }; - Ok(self.attach_all(target.clone())) + Ok(self.attach_all(&target.clone())) } /// Attach all capabilities we have that were issued by `target` to the next message. pub fn attach_all(mut self, target: &Address) -> Self { From 13b315cb8eb59404d5f887d9c87f3537b779d1da Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Tue, 10 Dec 2024 11:40:18 -0800 Subject: [PATCH 3/5] fix `try_attach_all()` method again**2 --- src/types/response.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/types/response.rs b/src/types/response.rs index e371244..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.clone())) - } /// 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(); From a11e32bf11349e8ed294844c2256c83a55bd5eed Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Tue, 10 Dec 2024 11:41:32 -0800 Subject: [PATCH 4/5] fix `try_attach_all()` method again**3 --- src/types/request.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/request.rs b/src/types/request.rs index 2de1322..0dcce9f 100644 --- a/src/types/request.rs +++ b/src/types/request.rs @@ -247,7 +247,7 @@ impl Request { let Some(ref target) = self.target else { return Err(BuildError::NoTarget); }; - Ok(self.attach_all(&target.clone())) + Ok(self.attach_all(target.clone().as_ref())) } /// Attach all capabilities we have that were issued by `target` to the next message. pub fn attach_all(mut self, target: &Address) -> Self { From 8a5b040dd699ae69d5bc1826fdd6e0bd5d84e766 Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Tue, 10 Dec 2024 11:42:47 -0800 Subject: [PATCH 5/5] fix `try_attach_all()` method again**4 --- src/types/request.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/types/request.rs b/src/types/request.rs index 0dcce9f..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.clone().as_ref())) + 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 {