Skip to content

Commit

Permalink
chore: Upgrade to Winnow 0.7 (#183)
Browse files Browse the repository at this point in the history
* chore: Upgrade to Winnow 0.6.26

* chore: Resolve deprecations

* chore: Upgrade to Winnow 0.7

* refactor: Simplify parser error type
  • Loading branch information
epage authored Jan 30, 2025
1 parent 7e9fa20 commit 542e603
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
27 changes: 18 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ semver = "1.0.23"
serde = { version = "1.0.210", features = ["derive"] }
toml_edit = "0.22.22"
url = "2.5.2"
winnow = "0.6.20"
winnow = "0.7.0"
clap-cargo = "0.14.1"

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::HashMap, env, ffi::OsString, io, path::PathBuf};

use anyhow::Context;
use cargo::{core::shell::Shell, util::context::GlobalContext};
use winnow::{token::take_until, PResult, Parser};
use winnow::{token::take_until, Parser};

pub fn get_registry_name_from_url(
working_dir: PathBuf,
Expand Down Expand Up @@ -74,7 +74,7 @@ fn get_registry_from_env(
None
}

fn registry_key(input: &str) -> PResult<&str> {
fn registry_key(input: &str) -> winnow::Result<&str> {
// Format CARGO_REGISTRIES_{REGISTRY_NAME}_INDEX
let (_, (_, registry)) = ("CARGO_REGISTRIES_", take_until(0.., "_INDEX")).parse_peek(input)?;

Expand Down

0 comments on commit 542e603

Please sign in to comment.