Commit 3c82651
glib: refactor GStr and GString constructors
Optimizes GString to avoid unnecessary checking for interior nul bytes.
Interior nul bytes will now only be checked upon request. When
converting to C strings, the string will always get truncated to the
first nul byte. Since GString can now contain interior nul bytes in some
circumstances, its interior representation is now Option<Box<str>>.
Also adds custom error types for conversions.1 parent 291607c commit 3c82651
3 files changed
+642
-118
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
0 commit comments