Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make ParseError public and reuse ArchiveType #167

Merged
merged 1 commit into from
Apr 15, 2023
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
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