You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rust’s standard library provides robust string handling, but when additional flexibility is needed, `string_more` steps in with efficient, allocation-friendly operations.
51
+
With both in-place and immutable operations, `string_more` is ideal for optimizing string manipulation in your Rust projects.
52
+
40
53
## Methods Overview
41
54
42
55
### `StringExt` (In-place operations for `String`)
-**`longest_common_substring`**: Returns the longest common substring.
199
212
200
-
Rust’s standard library provides robust string handling, but when additional flexibility is needed, `string_more` steps in with efficient, allocation-friendly operations.
201
-
With both in-place and immutable operations, `string_more` is ideal for optimizing string manipulation in your Rust projects.
213
+
```rust
214
+
lets="sparrow";
215
+
s.longest_common_substring("crow"); // "row"
216
+
```
217
+
218
+
-**`next_char_boundary`**: Returns the byte index of the next char boundary in string starting from index.
219
+
220
+
```rust
221
+
lets="🦀";
222
+
s.next_char_boundary(2); // 4
223
+
```
224
+
225
+
-**`previous_char_boundary`**: Returns the byte index of the previous char boundary in string starting from index.
226
+
227
+
```rust
228
+
lets="🦀";
229
+
s.previous_char_boundary(2); // 0
230
+
```
231
+
232
+
## Safety and Coverage
233
+
234
+
This crate contains a small portion of unsafe code.
235
+
All tests run under [miri](https://github.com/rust-lang/miri) and the tests cover about 90% of the code.
236
+
You can generate the coverage report using [tarpaulin](https://github.com/xd009642/tarpaulin).
0 commit comments