diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a5edba36..90fa54f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -109,7 +109,7 @@ jobs: - name: Install Rust toolchain uses: artichoke/setup-rust/build-and-test@v1.12.1 with: - toolchain: "1.58.0" + toolchain: "1.76.0" - name: Compile run: cargo build --verbose diff --git a/.ruby-version b/.ruby-version index 619b5376..9c25013d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.3 +3.3.6 diff --git a/Cargo.toml b/Cargo.toml index 7ae49602..39fa6c07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "intaglio" -version = "1.9.1" # remember to set `html_root_url` in `src/lib.rs`. +version = "1.10.0" # remember to set `html_root_url` in `src/lib.rs`. authors = ["Ryan Lopopolo "] license = "MIT" edition = "2021" -rust-version = "1.58.0" +rust-version = "1.76.0" readme = "README.md" repository = "https://github.com/artichoke/intaglio" documentation = "https://docs.rs/intaglio" @@ -12,7 +12,7 @@ homepage = "https://github.com/artichoke/intaglio" description = "UTF-8 string and byte string interner and symbol table" keywords = ["bytestring", "intern", "interner", "symbol", "utf8"] categories = ["caching", "data-structures"] -include = ["src/**/*", "tests/**/*", "LICENSE", "README.md"] +include = ["/src/**/*", "/tests/**/*", "/LICENSE", "/README.md"] [features] # All features are enabled by default. diff --git a/Gemfile.lock b/Gemfile.lock index 29018c0b..04166782 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,4 +43,4 @@ DEPENDENCIES rubocop-rake (~> 0.6) BUNDLED WITH - 2.5.15 + 2.5.23 diff --git a/README.md b/README.md index 0a9d58f4..cee74189 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -intaglio = "1.9.1" +intaglio = "1.10.0" ``` Then intern UTF-8 strings like: @@ -136,7 +136,7 @@ All features are enabled by default. ### Minimum Supported Rust Version -This crate requires at least Rust 1.58.0. This version can be bumped in minor +This crate requires at least Rust 1.76.0. This version can be bumped in minor releases. ## License diff --git a/src/bytes.rs b/src/bytes.rs index 22bb6164..c1f75662 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -89,7 +89,7 @@ pub struct AllSymbols<'a> { phantom: PhantomData<&'a SymbolTable>, } -impl<'a> Iterator for AllSymbols<'a> { +impl Iterator for AllSymbols<'_> { type Item = Symbol; fn next(&mut self) -> Option { @@ -123,7 +123,7 @@ impl<'a> Iterator for AllSymbols<'a> { } } -impl<'a> DoubleEndedIterator for AllSymbols<'a> { +impl DoubleEndedIterator for AllSymbols<'_> { fn next_back(&mut self) -> Option { let next = self.range.next_back()?; debug_assert!(u32::try_from(next).is_ok()); @@ -137,7 +137,7 @@ impl<'a> DoubleEndedIterator for AllSymbols<'a> { } } -impl<'a> FusedIterator for AllSymbols<'a> {} +impl FusedIterator for AllSymbols<'_> {} /// An iterator over all interned byte strings in a [`SymbolTable`]. /// @@ -188,7 +188,7 @@ impl<'a> Iterator for Bytestrings<'a> { } } -impl<'a> DoubleEndedIterator for Bytestrings<'a> { +impl DoubleEndedIterator for Bytestrings<'_> { fn next_back(&mut self) -> Option { self.0.next_back().map(Interned::as_slice) } @@ -205,13 +205,13 @@ impl<'a> DoubleEndedIterator for Bytestrings<'a> { } } -impl<'a> ExactSizeIterator for Bytestrings<'a> { +impl ExactSizeIterator for Bytestrings<'_> { fn len(&self) -> usize { self.0.len() } } -impl<'a> FusedIterator for Bytestrings<'a> {} +impl FusedIterator for Bytestrings<'_> {} /// An iterator over all symbols and interned byte strings in a [`SymbolTable`]. /// @@ -266,7 +266,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> FusedIterator for Iter<'a> {} +impl FusedIterator for Iter<'_> {} impl<'a, S> IntoIterator for &'a SymbolTable { type Item = (Symbol, &'a [u8]); diff --git a/src/cstr.rs b/src/cstr.rs index ec9704b3..75d702b1 100644 --- a/src/cstr.rs +++ b/src/cstr.rs @@ -96,7 +96,7 @@ pub struct AllSymbols<'a> { phantom: PhantomData<&'a SymbolTable>, } -impl<'a> Iterator for AllSymbols<'a> { +impl Iterator for AllSymbols<'_> { type Item = Symbol; fn next(&mut self) -> Option { @@ -130,7 +130,7 @@ impl<'a> Iterator for AllSymbols<'a> { } } -impl<'a> DoubleEndedIterator for AllSymbols<'a> { +impl DoubleEndedIterator for AllSymbols<'_> { fn next_back(&mut self) -> Option { let next = self.range.next_back()?; debug_assert!(u32::try_from(next).is_ok()); @@ -144,7 +144,7 @@ impl<'a> DoubleEndedIterator for AllSymbols<'a> { } } -impl<'a> FusedIterator for AllSymbols<'a> {} +impl FusedIterator for AllSymbols<'_> {} /// An iterator over all interned C strings in a [`SymbolTable`]. /// @@ -196,7 +196,7 @@ impl<'a> Iterator for CStrings<'a> { } } -impl<'a> DoubleEndedIterator for CStrings<'a> { +impl DoubleEndedIterator for CStrings<'_> { fn next_back(&mut self) -> Option { self.0.next_back().map(Interned::as_slice) } @@ -213,13 +213,13 @@ impl<'a> DoubleEndedIterator for CStrings<'a> { } } -impl<'a> ExactSizeIterator for CStrings<'a> { +impl ExactSizeIterator for CStrings<'_> { fn len(&self) -> usize { self.0.len() } } -impl<'a> FusedIterator for CStrings<'a> {} +impl FusedIterator for CStrings<'_> {} /// An iterator over all symbols and interned C strings in a [`SymbolTable`]. /// @@ -275,7 +275,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> FusedIterator for Iter<'a> {} +impl FusedIterator for Iter<'_> {} impl<'a, S> IntoIterator for &'a SymbolTable { type Item = (Symbol, &'a CStr); diff --git a/src/lib.rs b/src/lib.rs index 8dfd7bff..d2465d78 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -109,7 +109,7 @@ //! [`&Path`]: std::path::Path //! [`&'static Path`]: std::path::Path -#![doc(html_root_url = "https://docs.rs/intaglio/1.9.1")] +#![doc(html_root_url = "https://docs.rs/intaglio/1.10.0")] use core::fmt; use core::num::TryFromIntError; @@ -271,7 +271,7 @@ impl Symbol { mod tests { use core::cmp::Ordering; use core::fmt::Write as _; - use core::hash::{BuildHasher as _, Hash as _, Hasher as _}; + use core::hash::BuildHasher as _; use core::marker::Unpin; use core::panic::{RefUnwindSafe, UnwindSafe}; use std::collections::hash_map::RandomState; @@ -346,16 +346,8 @@ mod tests { let new = SymbolOverflowError::new(); let s = RandomState::new(); - let default_hash = { - let mut hasher = s.build_hasher(); - default.hash(&mut hasher); - hasher.finish() - }; - let new_hash = { - let mut hasher = s.build_hasher(); - new.hash(&mut hasher); - hasher.finish() - }; + let default_hash = s.hash_one(default); + let new_hash = s.hash_one(new); assert_eq!(default_hash, new_hash); } diff --git a/src/osstr.rs b/src/osstr.rs index 7cd5cc35..a2f04eb8 100644 --- a/src/osstr.rs +++ b/src/osstr.rs @@ -96,7 +96,7 @@ pub struct AllSymbols<'a> { phantom: PhantomData<&'a SymbolTable>, } -impl<'a> Iterator for AllSymbols<'a> { +impl Iterator for AllSymbols<'_> { type Item = Symbol; fn next(&mut self) -> Option { @@ -130,7 +130,7 @@ impl<'a> Iterator for AllSymbols<'a> { } } -impl<'a> DoubleEndedIterator for AllSymbols<'a> { +impl DoubleEndedIterator for AllSymbols<'_> { fn next_back(&mut self) -> Option { let next = self.range.next_back()?; debug_assert!(u32::try_from(next).is_ok()); @@ -144,7 +144,7 @@ impl<'a> DoubleEndedIterator for AllSymbols<'a> { } } -impl<'a> FusedIterator for AllSymbols<'a> {} +impl FusedIterator for AllSymbols<'_> {} /// An iterator over all interned platform strings in a [`SymbolTable`]. /// @@ -196,7 +196,7 @@ impl<'a> Iterator for OsStrings<'a> { } } -impl<'a> DoubleEndedIterator for OsStrings<'a> { +impl DoubleEndedIterator for OsStrings<'_> { fn next_back(&mut self) -> Option { self.0.next_back().map(Interned::as_slice) } @@ -213,13 +213,13 @@ impl<'a> DoubleEndedIterator for OsStrings<'a> { } } -impl<'a> ExactSizeIterator for OsStrings<'a> { +impl ExactSizeIterator for OsStrings<'_> { fn len(&self) -> usize { self.0.len() } } -impl<'a> FusedIterator for OsStrings<'a> {} +impl FusedIterator for OsStrings<'_> {} /// An iterator over all symbols and interned platform strings in a [`SymbolTable`]. /// @@ -275,7 +275,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> FusedIterator for Iter<'a> {} +impl FusedIterator for Iter<'_> {} impl<'a, S> IntoIterator for &'a SymbolTable { type Item = (Symbol, &'a OsStr); diff --git a/src/path.rs b/src/path.rs index 9487a8a1..ab71baad 100644 --- a/src/path.rs +++ b/src/path.rs @@ -96,7 +96,7 @@ pub struct AllSymbols<'a> { phantom: PhantomData<&'a SymbolTable>, } -impl<'a> Iterator for AllSymbols<'a> { +impl Iterator for AllSymbols<'_> { type Item = Symbol; fn next(&mut self) -> Option { @@ -130,7 +130,7 @@ impl<'a> Iterator for AllSymbols<'a> { } } -impl<'a> DoubleEndedIterator for AllSymbols<'a> { +impl DoubleEndedIterator for AllSymbols<'_> { fn next_back(&mut self) -> Option { let next = self.range.next_back()?; debug_assert!(u32::try_from(next).is_ok()); @@ -144,7 +144,7 @@ impl<'a> DoubleEndedIterator for AllSymbols<'a> { } } -impl<'a> FusedIterator for AllSymbols<'a> {} +impl FusedIterator for AllSymbols<'_> {} /// An iterator over all interned path strings in a [`SymbolTable`]. /// @@ -196,7 +196,7 @@ impl<'a> Iterator for Paths<'a> { } } -impl<'a> DoubleEndedIterator for Paths<'a> { +impl DoubleEndedIterator for Paths<'_> { fn next_back(&mut self) -> Option { self.0.next_back().map(Interned::as_slice) } @@ -213,13 +213,13 @@ impl<'a> DoubleEndedIterator for Paths<'a> { } } -impl<'a> ExactSizeIterator for Paths<'a> { +impl ExactSizeIterator for Paths<'_> { fn len(&self) -> usize { self.0.len() } } -impl<'a> FusedIterator for Paths<'a> {} +impl FusedIterator for Paths<'_> {} /// An iterator over all symbols and interned path strings in a [`SymbolTable`]. /// @@ -275,7 +275,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> FusedIterator for Iter<'a> {} +impl FusedIterator for Iter<'_> {} impl<'a, S> IntoIterator for &'a SymbolTable { type Item = (Symbol, &'a Path); diff --git a/src/str.rs b/src/str.rs index 17ae598d..bf674bfc 100644 --- a/src/str.rs +++ b/src/str.rs @@ -38,7 +38,7 @@ pub struct AllSymbols<'a> { phantom: PhantomData<&'a SymbolTable>, } -impl<'a> Iterator for AllSymbols<'a> { +impl Iterator for AllSymbols<'_> { type Item = Symbol; fn next(&mut self) -> Option { @@ -72,7 +72,7 @@ impl<'a> Iterator for AllSymbols<'a> { } } -impl<'a> DoubleEndedIterator for AllSymbols<'a> { +impl DoubleEndedIterator for AllSymbols<'_> { fn next_back(&mut self) -> Option { let next = self.range.next_back()?; debug_assert!(u32::try_from(next).is_ok()); @@ -86,7 +86,7 @@ impl<'a> DoubleEndedIterator for AllSymbols<'a> { } } -impl<'a> FusedIterator for AllSymbols<'a> {} +impl FusedIterator for AllSymbols<'_> {} /// An iterator over all interned strings in a [`SymbolTable`]. /// @@ -136,7 +136,7 @@ impl<'a> Iterator for Strings<'a> { } } -impl<'a> DoubleEndedIterator for Strings<'a> { +impl DoubleEndedIterator for Strings<'_> { fn next_back(&mut self) -> Option { self.0.next_back().map(Interned::as_slice) } @@ -153,13 +153,13 @@ impl<'a> DoubleEndedIterator for Strings<'a> { } } -impl<'a> ExactSizeIterator for Strings<'a> { +impl ExactSizeIterator for Strings<'_> { fn len(&self) -> usize { self.0.len() } } -impl<'a> FusedIterator for Strings<'a> {} +impl FusedIterator for Strings<'_> {} /// An iterator over all symbols and interned strings in a [`SymbolTable`]. /// @@ -212,7 +212,7 @@ impl<'a> Iterator for Iter<'a> { } } -impl<'a> FusedIterator for Iter<'a> {} +impl FusedIterator for Iter<'_> {} impl<'a, S> IntoIterator for &'a SymbolTable { type Item = (Symbol, &'a str);