Skip to content

Commit

Permalink
Merge pull request #39 from github/jorendorff/readme-edit
Browse files Browse the repository at this point in the history
string-offsets: Post-publish README editing pass
  • Loading branch information
aneubeck authored Nov 14, 2024
2 parents cab0842 + 80a8df3 commit 451b1bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/string-offsets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Converts string offsets between UTF-8 bytes, UTF-16 code units, Unicode code poi

Rust strings are UTF-8, but JavaScript has UTF-16 strings, and in Python, strings are sequences of
Unicode code points. It's therefore necessary to adjust string offsets when communicating across
programming language boundaries. [`StringOffsets`] does these adjustments.
programming language boundaries. `StringOffsets` does these adjustments.

Each `StringOffsets` instance contains offset information for a single string. [Building the data
structure](StringOffsets::new) takes O(n) time and memory, but then most conversions are O(1).
structure](https://docs.rs/string-offsets/latest/string_offsets/struct.StringOffsets.html#method.new) takes O(n) time and memory, but then most conversions are O(1).

["UTF-8 Conversions with BitRank"](https://adaptivepatchwork.com/2023/07/10/utf-conversion/) is a
blog post explaining the implementation.
Expand Down

0 comments on commit 451b1bf

Please sign in to comment.