,
{
Self {
- source: Source::new(None, Some(key.as_ref())),
+ source: Source::new(Some(key.as_ref())),
}
}
/// Choose a file to compress.
- ///
- /// # Examples
- ///
- /// ```
- /// use tinify::async_bin::Tinify as AsyncTinify;
- /// use tinify::error::TinifyError;
- ///
- /// #[tokio::main]
- /// async fn main() -> Result<(), TinifyError> {
- /// let key = "tinify api key";
- /// let tinify = AsyncTinify::new().set_key(key);
- /// let client = tinify.get_async_client()?;
- /// client
- /// .from_file("./unoptimized.jpg")
- /// .await?
- /// .to_file("./optimized.jpg")?;
- ///
- /// Ok(())
- /// }
- /// ```
- #[allow(clippy::wrong_self_convention)]
pub async fn from_file(self, path: P) -> Result