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
Error: Leading zeros in integers are not allowed, for example b'i00e'; read context: byte `48` (char: `0`), input pos 3, latest input bytes dump: [105, 48, 48] (UTF-8 string: `i00`); write context: byte `48` (char: `0`), output pos 2, latest output bytes dump: [48, 48] (UTF-8 string: `00`)
73
+
Error: Leading zeros in integers are not allowed, for example b'i00e'; read context: byte `48` (char: `0`), input pos 3, latest input bytes dump: [105, 48, 48] (UTF-8 string: `i00`)
println!("{output}"); // It prints the JSON string: "<string>spam</string>"
141
-
```
142
-
143
-
More [examples](./examples/).
117
+
See [examples](./examples/).
144
118
145
119
## Test
146
120
@@ -167,21 +141,19 @@ cargo cov
167
141
## Performance
168
142
169
143
In terms of memory usage this implementation consumes at least the size of the
170
-
biggest bencoded string. The string parser keeps all the string bytes in memory until
171
-
it parses the whole string, in order to convert it to UTF-8, when it's possible.
144
+
biggest bencoded integer or string. The string and integer parsers keeps all the bytes in memory until
145
+
it parses the whole value.
172
146
173
147
The library also wraps the input and output streams in a [BufReader](https://doc.rust-lang.org/std/io/struct.BufReader.html)
174
148
and [BufWriter](https://doc.rust-lang.org/std/io/struct.BufWriter.html) because it can be excessively inefficient to work directly with something that implements [Read](https://doc.rust-lang.org/std/io/trait.Read.html) or [Write](https://doc.rust-lang.org/std/io/trait.Write.html).
175
149
176
150
## TODO
177
151
178
-
-[ ] More examples of using the library.
179
152
-[ ] Counter for number of items in a list for debugging and errors.
180
153
-[ ] Fuzz testing: Generate random valid bencoded values.
0 commit comments