Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:
- { rust: stable, os: ubuntu-latest, flags: "--no-default-features" }
- { rust: stable, os: ubuntu-latest, target: wasm32-unknown-unknown, flags: "--all-features" }
- { rust: stable, os: ubuntu-latest, target: wasm32-unknown-unknown, flags: "--no-default-features" }
- { rust: 1.58.1, os: ubuntu-latest, flags: "--all-features" }
- { rust: 1.58.1, os: ubuntu-latest, flags: "--no-default-features" }
- { rust: 1.65.0, os: ubuntu-latest, flags: "--all-features" }
- { rust: 1.65.0, os: ubuntu-latest, flags: "--no-default-features" }
steps:
- uses: actions/checkout@v2
- name: Install Rust ${{ matrix.rust }} ${{ matrix.target }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "typed-path"
description = "Provides typed variants of Path and PathBuf for Unix and Windows"
version = "0.10.0"
edition = "2021"
rust-version = "1.58.1"
rust-version = "1.65.0"
authors = ["Chip Senkbeil <[email protected]>"]
categories = ["development-tools", "filesystem", "os"]
keywords = ["unicode", "utf8", "paths", "filesystem"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
[doc_lnk]: https://docs.rs/typed-path
[ci_img]: https://github.com/chipsenkbeil/typed-path/actions/workflows/ci.yml/badge.svg
[ci_lnk]: https://github.com/chipsenkbeil/typed-path/actions/workflows/ci.yml
[rustc_img]: https://img.shields.io/badge/rustc_1.58.1+-lightgray.svg
[rustc_lnk]: https://blog.rust-lang.org/2022/01/20/Rust-1.58.1.html
[rustc_img]: https://img.shields.io/badge/rustc_1.65.0+-lightgray.svg
[rustc_lnk]: https://blog.rust-lang.org/2022/11/03/Rust-1.65.0/
Comment on lines +11 to +12
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 1.65.0 the new minimum version that we'll need to support to do this? I was looking at bumping the minimum version, but hadn't done it yet, hence why we support a suuuuuuper old version of 1.58.1.

Reason I ask is to make sure I know what feature(s) from this new minimum version we need, and also we'll need to update both the Github action - some of the tests run with 1.58.1 - and the minimum version referenced in the Cargo.toml file.

I'm actually surprised that the code compiles and passes in Github actions because I thought we had some actions that are using rust 1.58.1 explicitly.

Anyway, two action items after scanning the contribution - thanks for doing this, btw! - are

  1. Update the minimum supported version in Cargo.toml
  2. Update the minimum test version used in .github/workflows/ci.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used cargo msrv find and it figured out that 1.65.0 is the version, which makes sense as there GATs were stabilized

Why it can pass CI on earlier versions I have no idea, unless those are nightly, where GATs could be for a while longer before

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fominok I just merged a tiny PR that switches the github action being used to install the Rust toolchain. Reading the logs, seems like while it installed the minimum version it never switched to using it, hence not hitting errors.

So rebase your PR and then go in and update the minimum version from 1.58.1 to 1.65.0. This way, we can see it go from not compiling to compiling :)


Provides typed variants of [`Path`][StdPath] and [`PathBuf`][StdPathBuf] for
Unix and Windows.
Expand Down
6 changes: 3 additions & 3 deletions src/common/non_utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ use crate::no_std_compat::*;
use crate::private;

/// Interface to provide meaning to a byte slice such that paths can be derived
pub trait Encoding<'a>: private::Sealed {
pub trait Encoding: private::Sealed {
/// Represents the type of component that will be derived by this encoding
type Components: Components<'a>;
type Components<'a>: Components<'a>;

/// Static label representing encoding type
fn label() -> &'static str;

/// Produces an iterator of [`Component`]s over the given the byte slice (`path`)
fn components(path: &'a [u8]) -> Self::Components;
fn components(path: &[u8]) -> Self::Components<'_>;

/// Hashes a byte slice (`path`)
fn hash<H: Hasher>(path: &[u8], h: &mut H);
Expand Down
30 changes: 15 additions & 15 deletions src/common/non_utf8/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ use crate::{Component, Components, Encoding, Path};
#[derive(Clone)]
pub struct Iter<'a, T>
where
T: Encoding<'a>,
T: Encoding,
{
_encoding: PhantomData<T>,
inner: <T as Encoding<'a>>::Components,
inner: <T as Encoding>::Components<'a>,
}

impl<'a, T> Iter<'a, T>
where
T: for<'enc> Encoding<'enc> + 'a,
T: Encoding,
{
pub(crate) fn new(inner: <T as Encoding<'a>>::Components) -> Self {
pub(crate) fn new(inner: <T as Encoding>::Components<'a>) -> Self {
Self {
_encoding: PhantomData,
inner,
Expand Down Expand Up @@ -51,16 +51,16 @@ where

impl<'a, T> fmt::Debug for Iter<'a, T>
where
T: for<'enc> Encoding<'enc> + 'a,
T: for<'enc> Encoding + 'a,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
struct DebugHelper<'a, T>(&'a Path<T>)
where
T: for<'enc> Encoding<'enc>;
T: for<'enc> Encoding;

impl<T> fmt::Debug for DebugHelper<'_, T>
where
T: for<'enc> Encoding<'enc>,
T: for<'enc> Encoding,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_list().entries(self.0.iter()).finish()
Expand All @@ -75,7 +75,7 @@ where

impl<'a, T> AsRef<Path<T>> for Iter<'a, T>
where
T: for<'enc> Encoding<'enc> + 'a,
T: for<'enc> Encoding + 'a,
{
#[inline]
fn as_ref(&self) -> &Path<T> {
Expand All @@ -85,7 +85,7 @@ where

impl<'a, T> AsRef<[u8]> for Iter<'a, T>
where
T: for<'enc> Encoding<'enc> + 'a,
T: for<'enc> Encoding + 'a,
{
#[inline]
fn as_ref(&self) -> &[u8] {
Expand All @@ -95,7 +95,7 @@ where

impl<'a, T> Iterator for Iter<'a, T>
where
T: for<'enc> Encoding<'enc> + 'a,
T: for<'enc> Encoding + 'a,
{
type Item = &'a [u8];

Expand All @@ -110,7 +110,7 @@ where

impl<'a, T> DoubleEndedIterator for Iter<'a, T>
where
T: for<'enc> Encoding<'enc> + 'a,
T: for<'enc> Encoding + 'a,
{
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
Expand All @@ -121,7 +121,7 @@ where
}
}

impl<'a, T> FusedIterator for Iter<'a, T> where T: for<'enc> Encoding<'enc> + 'a {}
impl<'a, T> FusedIterator for Iter<'a, T> where T: for<'enc> Encoding + 'a {}

/// An iterator over [`Path`] and its ancestors.
///
Expand All @@ -145,14 +145,14 @@ impl<'a, T> FusedIterator for Iter<'a, T> where T: for<'enc> Encoding<'enc> + 'a
#[derive(Copy, Clone, Debug)]
pub struct Ancestors<'a, T>
where
T: for<'enc> Encoding<'enc>,
T: for<'enc> Encoding,
{
pub(crate) next: Option<&'a Path<T>>,
}

impl<'a, T> Iterator for Ancestors<'a, T>
where
T: for<'enc> Encoding<'enc>,
T: for<'enc> Encoding,
{
type Item = &'a Path<T>;

Expand All @@ -164,4 +164,4 @@ where
}
}

impl<T> FusedIterator for Ancestors<'_, T> where T: for<'enc> Encoding<'enc> {}
impl<T> FusedIterator for Ancestors<'_, T> where T: for<'enc> Encoding {}
Loading