From 2d385bceca8a936eaa40c7bde53d9a8270167f57 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 8 Mar 2021 20:12:52 +0000 Subject: [PATCH] extension traits: Use extend::ext Signed-off-by: Ian Jackson --- apitest/at-otter.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index ea98584b..cb9d6752 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -71,8 +71,10 @@ mod scraper_ext { dom } - pub trait RequestBuilderExt: Sized { - fn send(self) -> Result; + #[ext(pub, name=RequestBuilderExt)] + impl reqwest::blocking::RequestBuilder { + #[throws(AE)] + fn send(self) -> reqwest::blocking::Response { self.send()? } #[throws(AE)] fn send_parse_html(self) -> Html { @@ -80,11 +82,6 @@ mod scraper_ext { parse_html(resp)? } } - - impl RequestBuilderExt for reqwest::blocking::RequestBuilder { - #[throws(AE)] - fn send(self) -> reqwest::blocking::Response { self.send()? } - } } use scraper_ext::{HtmlExt, RequestBuilderExt}; -- 2.30.2