cli: add recoverable endian APIs and qualified std enums
This commit is contained in:
45 files changed
+1205
-89
No files matched your search
@@ -0,0 +1,15 @@
|
||||
// expect: reject E7005
|
||||
// phase: 6
|
||||
// spec: docs/spec/16-standard-library.md §2.3; docs/spec/15-source-language.md §13
|
||||
module test.endian
|
||||
import std.bytes;
|
||||
|
||||
enum ReadU16 { ok(u16), short_input }
|
||||
fn main() -> u8
|
||||
effects []
|
||||
{
|
||||
match std.bytes.read_u16_le(b"xx") {
|
||||
ReadU16::ok(value) => { return 0; }
|
||||
ReadU16::short_input => { return 1; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user