Skip to content

feat(data_structures): add AnyInlineString trait#10857

Closed
overlookmotel wants to merge 1 commit into05-06-feat_data_structures_add_inlinestring_as_mut_str_methodfrom
05-07-feat_data_structures_add_anyinlinestring_trait
Closed

feat(data_structures): add AnyInlineString trait#10857
overlookmotel wants to merge 1 commit into05-06-feat_data_structures_add_inlinestring_as_mut_str_methodfrom
05-07-feat_data_structures_add_anyinlinestring_trait

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented May 7, 2025

Add AnyInlineString trait. Due to limitations in Rust const generics, this is required to define a trait which is generic over InlineStrings with varying capacities.

This won't compile:

trait MyTrait {
    const CAPACITY: usize;
    fn get_str(&self) -> InlineString<Self::CAPACITY, u8>;
}

You can achieve the same thing with AnyInlineString (and this will compile):

trait MyTrait {
    type Str: AnyInlineString;
    fn get_str(&self) -> Self::Str;
}

@github-actions github-actions bot added the C-enhancement Category - New feature or request label May 7, 2025
Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented May 7, 2025

CodSpeed Instrumentation Performance Report

Merging #10857 will not alter performance

Comparing 05-07-feat_data_structures_add_anyinlinestring_trait (aabc016) with 05-06-feat_data_structures_add_inlinestring_as_mut_str_method (dde60ff)

Summary

✅ 36 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as ready for review May 7, 2025 12:22
@overlookmotel
Copy link
Member Author

We have no use for this at present - I made this for something I was working on which I've now abandonned. So closing.

@Boshen Boshen deleted the 05-07-feat_data_structures_add_anyinlinestring_trait branch August 30, 2025 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant