Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Tag cannot end with colon
Browse files Browse the repository at this point in the history
  • Loading branch information
morrisonlevi committed Mar 30, 2022
1 parent ab1ceb5 commit 43b484f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ddprof-ffi/src/exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ fn parse_tag_chunk(chunk: &str) -> Result<Tag, TagsError> {
return Err(TagsError {
message: format!("tag cannot start with a colon: \"{}\"", chunk),
});
} else if first_colon_position == chunk.chars().count() {
}

if chunk.ends_with(':') {
return Err(TagsError {
message: format!("tag cannot end with a colon: \"{}\"", chunk),
});
Expand Down Expand Up @@ -494,6 +496,10 @@ mod test {
Tag::new("key3", "value3"),
],
),
(
"key1:",
vec![],
),
];

for case in cases {
Expand Down

0 comments on commit 43b484f

Please sign in to comment.