diff --git a/thirtyfour/src/common/capabilities/chromium.rs b/thirtyfour/src/common/capabilities/chromium.rs index 19b94a4..85b3da2 100644 --- a/thirtyfour/src/common/capabilities/chromium.rs +++ b/thirtyfour/src/common/capabilities/chromium.rs @@ -135,7 +135,7 @@ pub trait ChromiumLikeCapabilities: BrowserCapabilitiesHelper { } /// Add Chrome extension file. This will be a file with a .CRX extension. - fn add_extension(&mut self, crx_file: impl AsRef) -> WebDriverResult<()> { + fn add_extension(&mut self, crx_file: &Path) -> WebDriverResult<()> { let contents = std::fs::read(crx_file)?; let b64_contents = BASE64_STANDARD.encode(contents); self.add_encoded_extension(&b64_contents) @@ -143,7 +143,7 @@ pub trait ChromiumLikeCapabilities: BrowserCapabilitiesHelper { /// Remove the specified Chrome extension file if an identical extension had been added /// previously. - fn remove_extension(&mut self, crx_file: impl AsRef) -> WebDriverResult<()> { + fn remove_extension(&mut self, crx_file: &Path) -> WebDriverResult<()> { let contents = std::fs::read(crx_file)?; let b64_contents = BASE64_STANDARD.encode(contents); self.remove_encoded_extension(&b64_contents) diff --git a/thirtyfour/src/extensions/addons/firefox/firefoxtools.rs b/thirtyfour/src/extensions/addons/firefox/firefoxtools.rs index 662f2f2..e7e88da 100644 --- a/thirtyfour/src/extensions/addons/firefox/firefoxtools.rs +++ b/thirtyfour/src/extensions/addons/firefox/firefoxtools.rs @@ -62,7 +62,7 @@ impl FirefoxTools { } /// Take a full-page screenshot of the current window and write it to the specified filename. - pub async fn full_screenshot(&self, path: impl AsRef) -> WebDriverResult<()> { + pub async fn full_screenshot(&self, path: &Path) -> WebDriverResult<()> { let png = self.full_screenshot_as_png().await?; support::write_file(path, png).await?; Ok(()) diff --git a/thirtyfour/src/session/handle.rs b/thirtyfour/src/session/handle.rs index bd335ed..e0ed717 100644 --- a/thirtyfour/src/session/handle.rs +++ b/thirtyfour/src/session/handle.rs @@ -1058,7 +1058,7 @@ impl SessionHandle { } /// Take a screenshot of the current window and write it to the specified filename. - pub async fn screenshot(&self, path: impl AsRef) -> WebDriverResult<()> { + pub async fn screenshot(&self, path: &Path) -> WebDriverResult<()> { let png = self.screenshot_as_png().await?; support::write_file(path, png).await?; Ok(()) diff --git a/thirtyfour/src/web_element.rs b/thirtyfour/src/web_element.rs index 36e353b..85ebc74 100644 --- a/thirtyfour/src/web_element.rs +++ b/thirtyfour/src/web_element.rs @@ -649,7 +649,7 @@ impl WebElement { } /// Take a screenshot of this WebElement and write it to the specified filename. - pub async fn screenshot(&self, path: impl AsRef) -> WebDriverResult<()> { + pub async fn screenshot(&self, path: &Path) -> WebDriverResult<()> { let png = self.screenshot_as_png().await?; support::write_file(path, png).await?; Ok(())