Skip to content

Return NonZero from len() and capacity()#30

Draft
cgzones wants to merge 1 commit intoMidasLamb:masterfrom
cgzones:nonzero
Draft

Return NonZero from len() and capacity()#30
cgzones wants to merge 1 commit intoMidasLamb:masterfrom
cgzones:nonzero

Conversation

@cgzones
Copy link
Contributor

@cgzones cgzones commented Sep 7, 2025

Since the string s guaranteed to be non-empty, its length and capacity are similarly guaranteed to be non-zero.
Use NonZero to signal this invariant.

Breaking change due to API change.

Since the string s guaranteed to be non-empty, its length and capacity
are similarly guaranteed to be non-zero. Use NonZero to signal this
invariant.

Breaking change due to API change.
@Iizuki
Copy link

Iizuki commented Mar 2, 2026

This would seem like a reasonable change to me. Keeping the guarantees at type level where possible

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