Skip to content

Commit

Permalink
string-offsets: Post-publish README editing pass
Browse files Browse the repository at this point in the history
  • Loading branch information
jorendorff committed Nov 13, 2024
1 parent a2735a4 commit db8e839
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 db8e839

Please sign in to comment.