Skip to content

Conversation

@awillenbuecher-xq-tec
Copy link
Contributor

This PR adds two data structures to the Rust base libs: an inline-storage (ABI-compatible) and a fixed-capacity UTF-8 string. Refer to the feature request for more information about ABI compatibility.
It also adds fallible try_new() methods to the heap-allocated containers to provide non-panicking constructors.

Pre-Review Checklist for the PR Author

  • PR title is short, expressive and meaningful
  • Commits are properly organized
  • Relevant issues are linked in the References section
  • Tests are conducted
  • Unit tests are added

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  • All open points are addressed and tracked via issues

References

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.4.2) and connecting to it...
INFO: Invocation ID: a18a8222-08bd-4b75-a636-40873f6ba601
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
DEBUG: Rule 'rust_qnx8_toolchain+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-eQOopREOYCL5vtTb6c1cwZrql4GVrJ1FqgxarQRe1xs="
DEBUG: Repository rust_qnx8_toolchain+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:431:31: in <toplevel>
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'aspect_rules_lint', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'buildifier_prebuilt', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (32 packages loaded, 9 targets configured)

Analyzing: target //:license-check (126 packages loaded, 453 targets configured)

Analyzing: target //:license-check (136 packages loaded, 1646 targets configured)

Analyzing: target //:license-check (142 packages loaded, 2567 targets configured)

Analyzing: target //:license-check (147 packages loaded, 2616 targets configured)

Analyzing: target //:license-check (151 packages loaded, 4750 targets configured)

INFO: Analyzed target //:license-check (152 packages loaded, 4876 targets configured).
INFO: From Generating Dash formatted dependency file ...:
WARNING: No packages found in Cargo.lock.
INFO: Successfully converted 0 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 31.752s, Critical Path: 0.45s
INFO: 14 processes: 5 disk cache hit, 9 internal.
INFO: Build completed successfully, 14 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

The created documentation from the pull request is available at: docu-html

///
/// If the string has sufficient spare capacity, the operation succeeds and a reference to the new characters is returned;
/// otherwise, `Err(InsufficientCapacity)` is returned.
pub fn push_str(&mut self, other: &str) -> Result<&mut str, InsufficientCapacity> {
Copy link
Contributor

Choose a reason for hiding this comment

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

why we return &mut str instead () ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for consistency with the vector and queue which return &mut T, and where push-element-then-modify-by-reference can sometimes be quite useful. For a string this is probably rarely useful, so if you think it's confusing, I can change it to ().

Copy link
Contributor

Choose a reason for hiding this comment

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

ye I would remove it, very inlinke usage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

}

/// Returns the current number of bytes in the string.
pub fn len(&self) -> usize {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall be more precise in all doc this is not char and it's not what one can think it is. IE 😄 would be 1 but its 4 i guess.
So it's not printable len at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@pawelrutkaq
Copy link
Contributor

@awillenbuecher-xq-tec we can rebase and ask @4og to merge if no more reviewers willing to review

@awillenbuecher-xq-tec
Copy link
Contributor Author

Rebased onto main. The formatting checks fail due to #33 and should be ignored until that issue has been fixed.

@4og 4og merged commit cd10951 into eclipse-score:main Dec 12, 2025
10 of 11 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.

[Rust] Fixed-capacity string [Rust] ABI-compatible string

3 participants