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

Clean up fansi.Str constructors #43

Merged
merged 2 commits into from
Dec 6, 2021
Merged

Clean up fansi.Str constructors #43

merged 2 commits into from
Dec 6, 2021

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Dec 5, 2021

  • Remove case modifier from fansi.Str: we're already overriding apply, equals, hashcode, etc. so being a case class buys us nothing.

  • Rename fansi.Str.join to fansi.Str.apply, to provide an easy way of concatenating a bunch of string literals e.g. fansi.Str("hello", "world", "i am cow")

  • Added a new fansi.Str.join method that takes a Seq[fansi.Str], to make it a bit more ergonomic to join such Seqs together. Also include an optional sep argument, to handle the use case that mkString satisfies on Seq[String]

This is a breaking change, so since we're already breaking compat in a few places in com-lihaoyi we should include this in the update

Review by @lolgab

@lihaoyi lihaoyi requested a review from lolgab December 5, 2021 00:53
@lihaoyi lihaoyi merged commit ee6363f into master Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants