From e82dce00c0357b92e60e16c96113b02f69879009 Mon Sep 17 00:00:00 2001 From: Sam Denty Date: Tue, 3 May 2022 23:35:09 +0100 Subject: [PATCH] Send + Sync --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- src/icon_info.rs | 2 +- src/icon_size/ico.rs | 2 +- src/icon_size/jpeg.rs | 2 +- src/icon_size/mod.rs | 2 +- src/icon_size/png.rs | 2 +- src/icons.rs | 4 ++-- src/lib.rs | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3970589..9666664 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,9 +295,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.8.4" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" dependencies = [ "atty", "humantime", @@ -1494,7 +1494,7 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "site_icons" -version = "0.1.7" +version = "0.1.9" dependencies = [ "byteorder", "clap", diff --git a/Cargo.toml b/Cargo.toml index 1a50f5c..1ccf9db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "site_icons" -version = "0.1.8" +version = "0.1.9" authors = ["Sam Denty "] edition = "2018" license = "GPL-3.0" diff --git a/src/icon_info.rs b/src/icon_info.rs index e4946a8..e1a2abb 100644 --- a/src/icon_info.rs +++ b/src/icon_info.rs @@ -30,7 +30,7 @@ pub enum IconInfo { } impl IconInfo { - pub async fn load(url: Url, sizes: Option) -> Result> { + pub async fn load(url: Url, sizes: Option) -> Result> { let sizes = sizes.as_ref().and_then(|s| IconSizes::from_str(s).ok()); let (mime, mut body): (_, Box) = match url.scheme() { diff --git a/src/icon_size/ico.rs b/src/icon_size/ico.rs index 3c7d64f..8e5486d 100644 --- a/src/icon_size/ico.rs +++ b/src/icon_size/ico.rs @@ -12,7 +12,7 @@ const INDEX_SIZE: u16 = 16; pub async fn get_ico_sizes( reader: &mut R, -) -> Result> { +) -> Result> { let mut offset = 0; let mut header = [0; 6]; reader.read_exact(&mut header).await?; diff --git a/src/icon_size/jpeg.rs b/src/icon_size/jpeg.rs index 6c32faa..012e8c7 100644 --- a/src/icon_size/jpeg.rs +++ b/src/icon_size/jpeg.rs @@ -6,7 +6,7 @@ use tokio_futures_byteorder::AsyncReadBytesExt; pub async fn get_jpeg_size( reader: &mut R, -) -> Result> { +) -> Result> { let mut data = [0; 2]; reader.read_exact(&mut data).await?; let data = &mut Cursor::new(data); diff --git a/src/icon_size/mod.rs b/src/icon_size/mod.rs index 398f172..cd5ae31 100644 --- a/src/icon_size/mod.rs +++ b/src/icon_size/mod.rs @@ -88,7 +88,7 @@ fn slice_eq( cur: &mut T, offset: u64, slice: &[u8], -) -> Result> { +) -> Result> { cur.seek(SeekFrom::Start(offset))?; let mut buffer = vec![0; slice.len()]; cur.read_exact(&mut buffer)?; diff --git a/src/icon_size/png.rs b/src/icon_size/png.rs index 8223b91..8d47d57 100644 --- a/src/icon_size/png.rs +++ b/src/icon_size/png.rs @@ -5,7 +5,7 @@ use std::{error::Error, io::Cursor}; pub async fn get_png_sizes( reader: &mut R, -) -> Result> { +) -> Result> { let mut header = [0; 24]; reader.read_exact(&mut header).await?; let header = &mut Cursor::new(header); diff --git a/src/icons.rs b/src/icons.rs index a79d0d3..16f9430 100644 --- a/src/icons.rs +++ b/src/icons.rs @@ -19,7 +19,7 @@ pub struct Icons { Url, ( IconKind, - Pin>>>>, + Pin>>>>, ), >, } @@ -28,7 +28,7 @@ fn add_icon_entry( entries: &mut Vec, url: Url, kind: IconKind, - info: Result>, + info: Result>, ) { match info { Ok(info) => entries.push(Icon { url, kind, info }), diff --git a/src/lib.rs b/src/lib.rs index e9e66a0..d6c6f45 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(async_closure, map_into_keys_values, bool_to_option)] +#![feature(async_closure, bool_to_option)] //! # site_icons //! An efficient website icon scraper. //!