Skip to content

Commit

Permalink
make ParseError public and reuse ArchiveType (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv authored Apr 15, 2023
1 parent 501380b commit 016f93c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/rattler_conda_types/src/match_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde_with::skip_serializing_none;
use std::fmt::{Debug, Display, Formatter};

pub mod matcher;
mod parse;
pub mod parse;

use matcher::StringMatcher;

Expand Down
3 changes: 2 additions & 1 deletion crates/rattler_conda_types/src/match_spec/parse.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::matcher::{StringMatcher, StringMatcherParseError};
use super::MatchSpec;
use crate::package::ArchiveType;
use crate::version_spec::{is_start_of_version_constraint, ParseVersionSpecError};
use crate::{ParseChannelError, VersionSpec};
use nom::branch::alt;
Expand Down Expand Up @@ -83,7 +84,7 @@ fn strip_if(input: &str) -> (&str, Option<&str>) {

/// Returns true if the specified string represents a package path.
fn is_package_file(input: &str) -> bool {
input.ends_with(".conda") || input.ends_with(".tar.bz2")
ArchiveType::try_from(input).is_some()
}

/// An optimized data structure to store key value pairs in between a bracket string
Expand Down

0 comments on commit 016f93c

Please sign in to comment.