diff options
| author | 2024-04-02 13:22:37 -0400 | |
|---|---|---|
| committer | 2024-04-02 13:22:37 -0400 | |
| commit | cc8d110f834d112a230024122fddfcc6e0a67759 (patch) | |
| tree | a69b7ef8fa81f82b9ce9a16ce489b696d237e284 /README.md | |
| parent | Updated README with zig fetch (diff) | |
| download | zg-cc8d110f834d112a230024122fddfcc6e0a67759.tar.gz zg-cc8d110f834d112a230024122fddfcc6e0a67759.tar.xz zg-cc8d110f834d112a230024122fddfcc6e0a67759.zip | |
NormData init now takes pointer to uninitialized Self to avoid stack copy issues.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -282,7 +282,8 @@ const Normalize = @import("Normalize"); | |||
| 282 | 282 | ||
| 283 | test "Normalization" { | 283 | test "Normalization" { |
| 284 | // We need lots of Unicode dta for normalization. | 284 | // We need lots of Unicode dta for normalization. |
| 285 | var norm_data = try Normalize.NormData.init(allocator); | 285 | var norm_data: Normalize.NormData = undefined; |
| 286 | try Normalize.NormData.init(&norm_data, allocator); | ||
| 286 | defer norm_data.deinit(); | 287 | defer norm_data.deinit(); |
| 287 | 288 | ||
| 288 | // The `Normalize` structure takes a pointer to the data. | 289 | // The `Normalize` structure takes a pointer to the data. |
| @@ -335,7 +336,8 @@ const CaseFold = @import("CaseFold"); | |||
| 335 | 336 | ||
| 336 | test "Caseless matching" { | 337 | test "Caseless matching" { |
| 337 | // We need to normalize during the matching process. | 338 | // We need to normalize during the matching process. |
| 338 | var norm_data = try Normalize.NormData.init(allocator); | 339 | var norm_data: Normalize.NormData = undefined; |
| 340 | try Normalize.NormData.init(&norm_data, allocator); | ||
| 339 | defer norm_data.deinit(); | 341 | defer norm_data.deinit(); |
| 340 | const n = Normalize{ .norm_data = &norm_data }; | 342 | const n = Normalize{ .norm_data = &norm_data }; |
| 341 | 343 | ||