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

What is the intended behaviour of AsciiStr.lines()? #51

Closed
tormol opened this issue Apr 13, 2018 · 2 comments
Closed

What is the intended behaviour of AsciiStr.lines()? #51

tormol opened this issue Apr 13, 2018 · 2 comments
Labels

Comments

@tormol
Copy link
Collaborator

tormol commented Apr 13, 2018

I assume "foo\nbar" producing ["foo"] is a bug,
But the lines_iter() test assert that AsciiStr::from("\n").lines() produces nothing, which is not what I expected, and also differs from str.lines() (which produces a single empty slice).

str.lines() handles "\r\n" and trailing newline, so could the (currently rather complex) implementation be replaced with a simple forwarding implementation?

EDIT on 2018-09-11: fixed typo "foo/nbar"and corrected .split() to .lines().

@tormol
Copy link
Collaborator Author

tormol commented Sep 11, 2018

Ping @tomprogrammer.

@tomprogrammer
Copy link
Owner

The implementations in ascii should generally behave similar to their couterparts in std. Therefore this is a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants