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 support for empty strings #54

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

Wynand
Copy link

@Wynand Wynand commented Aug 3, 2021

I ran into an issue where empty strings would cause an error:

julia> ss""
ERROR: ArgumentError: 0 is <= 0
Stacktrace:
 [1] get_type(maxlen::Int64; types::NTuple{7, DataType})
   @ ShortStrings ~/git-repos/julia_packages/ShortStrings.jl/src/base.jl:309
 [2] ShortString(str::String, maxlen::Int64; types::NTuple{7, DataType})
   @ ShortStrings ~/git-repos/julia_packages/ShortStrings.jl/src/base.jl:322
 [3] ShortString(str::String, maxlen::Int64)
   @ ShortStrings ~/git-repos/julia_packages/ShortStrings.jl/src/base.jl:322
 [4] top-level scope
   @ REPL[2]:1

After some brief digging I couldn't find any documented reason why empty strings shouldn't be allowed and it seemed simple enough to add support

src/base.jl Outdated Show resolved Hide resolved
test/runtests.jl Outdated Show resolved Hide resolved
Copy link
Member

@oxinabox oxinabox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also bump the version, so i can tag a release

@Wynand
Copy link
Author

Wynand commented Aug 3, 2021

please also bump the version, so i can tag a release

I bumped this as a bugfix, is that correct?

@oxinabox
Copy link
Member

oxinabox commented Aug 3, 2021

This is pre-1.0 so there is only breaking and nonbreaking, and this is indeed nonbreaking

@oxinabox oxinabox merged commit eeedb94 into JuliaString:master Aug 4, 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.

2 participants