Commit 4c8ebb1
committed
ffi: simplify
`FromBytesWithNulError` is a struct that only contains `kind:
FromBytesWithNulErrorKind`, which is an enum. This representation is
somewhat redundant.
Make `FromBytesWithNulError` an enum that is equivalent to current
`FromBytesWithNulErrorKind` in order to simplify. Additionally, add docs
for the enum members.
Note that this change aligns `FromBytesWithNulError` more closely with
`CStrConvertError` in the Linux kernel [1], which will utilize rustc's
`CStr` in the future.
[1]: https://github.com/Rust-for-Linux/linux/blob/ae7851c29747fa3765ecb722fe722117a346f988/rust/kernel/str.rs#L130-L138FromBytesWithNulError in core::c_str1 parent 4cc494b commit 4c8ebb1
1 file changed
+10
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
134 | 131 | | |
| 132 | + | |
135 | 133 | | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
142 | | - | |
| 140 | + | |
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
146 | | - | |
| 144 | + | |
147 | 145 | | |
148 | 146 | | |
149 | 147 | | |
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
153 | 151 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
159 | 155 | | |
160 | 156 | | |
161 | 157 | | |
| |||
200 | 196 | | |
201 | 197 | | |
202 | 198 | | |
203 | | - | |
| 199 | + | |
204 | 200 | | |
205 | 201 | | |
206 | 202 | | |
| |||
0 commit comments