Skip to content

Fix inconsistency#2

Merged
akiramusic000 merged 2 commits intotack-lang:mainfrom
YichiZhang0613:fix_inconsistency
Mar 5, 2026
Merged

Fix inconsistency#2
akiramusic000 merged 2 commits intotack-lang:mainfrom
YichiZhang0613:fix_inconsistency

Conversation

@YichiZhang0613
Copy link
Contributor

Their comments both requires string.len() <= SpanValue::MAX as usize while the code checks string.len() < SpanValue::MAX as usize. It looks like string.len() == SpanValue::MAX as usize should be allowed semantically and thus the code should be fixed.

///  # Panics
///  This function will panic if the input string's length is greater than [`SpanValue::MAX`].
pub fn full(string: &str) -> Self {
    assert!(
        string.len() < SpanValue::MAX as usize,
        "Length of `Span::full` input must be less than `SpanValue::MAX!`"
    );
...

/// # Panics
    /// This function will panic if the input string's length is greater than [`SpanValue::MAX`].
    pub fn full(string: &str) -> Self {
        assert!(
            string.len() < SpanValue::MAX as usize,
            "Length of `Span::full` input must be less than or equal to `SpanValue::MAX!`"
        );
...

@akiramusic000
Copy link
Member

akiramusic000 commented Mar 5, 2026

Thanks for the PR! Sorry I didn't respond to it sooner. Before I merge this, could you add your name to CONTRIBUTORS.md? Thanks!

Also, ignore the failing checks, those are from newer Clippy lints.

@YichiZhang0613
Copy link
Contributor Author

Thanks for the PR! Sorry I didn't respond to it sooner. Before I merge this, could you add your name to CONTRIBUTORS.md? Thanks!

Also, ignore the failing checks, those are from newer Clippy lints.

OK!

@akiramusic000 akiramusic000 merged commit f16e38c into tack-lang:main Mar 5, 2026
20 checks passed
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