)]}'
{
  "commit": "d8770033568cbb77895169163155d85aba73bed5",
  "tree": "ec072e26d875afa854b8d97a4fdd4a75fa075cfe",
  "parents": [
    "28913fdd14162f687c667b4e754ee8f07737b7ea",
    "f908a63f66bd026e76d0e26d36b79936793bc70c"
  ],
  "author": {
    "name": "bors[bot]",
    "email": "26634292+bors[bot]@users.noreply.github.com",
    "time": "Fri Feb 12 01:52:53 2021 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Feb 12 01:52:53 2021 +0000"
  },
  "message": "Merge #273\n\n273: Make ErrorCode an enum that exactly represents the ErrorCode values the kernel can return. r\u003dhudson-ayers a\u003djrvanwhy\n\nI previously made `ErrorCode` a struct that can represent any `u32` value because it was unclear what values future Tock versions may return. The Tock 2.0 TRD now says that the kernel will never return an error code of 0 or an error code greater than 1023, so we can rely on that.\r\n\r\nThis has the benefit of enabling niche optimizations on the type. The zero value is now a usable niche (zero being the most efficient value to compare against in many cases), as well as all values above 1023.\r\n\r\nThere are two drawbacks to this approach:\r\n\r\n1. 3 more uses of `unsafe` in `CommandReturn`, maybe a few extra uses in the `Syscalls` implementation.\r\n2. A huge block of reserved numbers in `ErrorCode`.\r\n\r\nI used the following code to generate the number block, and vim commands to format it:\r\n```\r\nfn main() {\r\n    for i in 1..\u003d1023 {\r\n        print!(\"N{:05} \u003d {:05}, \", i, i);\r\n        if i % 5 \u003d\u003d 0 { println!(); }\r\n    }\r\n}\r\n```\n\nCo-authored-by: Johnathan Van Why \u003cjrvanwhy@google.com\u003e\n",
  "tree_diff": []
}
