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

Add a method for joining an iterable of &strs while appending newlines to those that don't already end with one #7

Open
jwodder opened this issue May 9, 2024 · 0 comments
Labels
enhancement New feature or request therefor under consideration Dev has not yet decided whether or how to implement

Comments

@jwodder
Copy link
Owner

jwodder commented May 9, 2024

  • Technically, the "iterable of &strs" should be I: IntoIterator, I::Item: AsRef<str>.

  • Possible parameters (in addition to the iterable):

    • Option 1: A single Newline, to append to those strings that don't already end with it
    • Option 2: A Newline and a NewlineSet; the Newline is appended to those strings that don't already end with a newline in the NewlineSet
  • Possible return types:

    • Option 1: Return a String (requires std)
    • Option 2: Return an iterable containing the same elements as the original but with a newline yielded after each string that doesn't already end with a newline (doesn't require std)

Cf. #13

@jwodder jwodder added under consideration Dev has not yet decided whether or how to implement enhancement New feature or request therefor labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request therefor under consideration Dev has not yet decided whether or how to implement
Projects
None yet
Development

No branches or pull requests

1 participant