Skip to content

Commit

Permalink
Update crates/rattler_conda_types/src/match_spec/parse.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Bas Zalmstra <zalmstra.bas@gmail.com>
  • Loading branch information
ruben-arts and baszalmstra authored Jul 31, 2024
1 parent fc8ded3 commit 3c38655
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions crates/rattler_conda_types/src/match_spec/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,15 +529,9 @@ fn matchspec_parser(
// This assumes the [*] portions is stripped off, and then strip reverse to
// ignore the first colon As that might be in the channel url.
let mut input_split = input.rsplitn(3, ':').fuse();
let (input, namespace, channel_str) =
match (input_split.next(), input_split.next(), input_split.next()) {
(Some(input), None, _) => (input, None, None),
(Some(input), Some(namespace), None) => (input, Some(namespace), None),
(Some(input), Some(namespace), Some(channel_str)) => {
(input, Some(namespace), Some(channel_str))
}
(None, _, _) => ("", None, None),
};
let input = input_split.next().unwrap_or("");
let namespace = input_split.next();
let channel_str = input_split.next();

nameless_match_spec.namespace = namespace
.map(str::trim)
Expand Down

0 comments on commit 3c38655

Please sign in to comment.