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

Genericise implementation of key/value tags #1

Open
JeanMertz opened this issue Apr 3, 2019 · 0 comments
Open

Genericise implementation of key/value tags #1

JeanMertz opened this issue Apr 3, 2019 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@JeanMertz
Copy link
Member

Right now, you can have tags that contain a colon (:) and use the string on the left of the colon as the key of the tag, and the right side be the value:

bulletin/src/main.rs

Lines 68 to 73 in e16f06e

s.split_whitespace()
.map(|s| s.split(':').collect())
.filter(|v: &Vec<&str>| v.len() == 2)
.for_each(|v| {
values.insert(v[0].to_owned(), v[1].to_owned());
});

Some improvements to make here:

  • The character to split on should be configurable using --split-char.
  • If no split char is defined, then no splitting occurs, and and empty string is used as the default key.
  • Even if a split char is defined, any tag without the split char present, should be added to the map with an empty string as the default key.
@JeanMertz JeanMertz added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Apr 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Development

No branches or pull requests

1 participant