This repository was archived by the owner on Aug 18, 2020. It is now read-only.
Commit 1d6d9f7
Michael Hueschen
[CO-354] Fix SafeCopy instance for
From @dcoutts:
> The uncheckedLookAhead is actually a bit dangerous
> and rather misleading. It only does what you expect
> if all the input is supplied in one chunk, since it
> only looks up to the end of the chunk. If acid-state
> uses the incremental interface to deserialise in e.g.
> 4k chunks then this can fail at a chunk boundary.
I switch to using `Alternative` to run the non-legacy
parser first, and if it fails, to run the legacy parser.
This seems to leverage Cereal's `fail` mechanism the way
it is intended - when the first parser fails, no input is
consumed, and the second parser is run.AddrAttributes
1 parent 036f1b9 commit 1d6d9f7
1 file changed
+14
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
175 | 164 | | |
176 | 165 | | |
177 | 166 | | |
| |||
0 commit comments