)]}'
{
  "commit": "f908a63f66bd026e76d0e26d36b79936793bc70c",
  "tree": "1a69fb1db24a00018e4206ff82f49c60b4185766",
  "parents": [
    "dab5817bcf2b0f9db645bbba5cc6f9c71e9c0e38"
  ],
  "author": {
    "name": "Johnathan Van Why",
    "email": "jrvanwhy@google.com",
    "time": "Thu Feb 04 21:46:07 2021 -0800"
  },
  "committer": {
    "name": "Johnathan Van Why",
    "email": "jrvanwhy@google.com",
    "time": "Thu Feb 04 21:46:07 2021 -0800"
  },
  "message": "Make ErrorCode an enum that exactly represents the ErrorCode values the kernel can return.\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.\n\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.\n\nThere are two drawbacks to this approach:\n\n1. 3 more uses of `unsafe` in CommandReturn, maybe a few extra uses in the Syscalls implementation.\n2. A huge block of reserved numbers in ErrorCode.\n\nI used the following code to generate the number block, and vim commands to format it:\n```\nfn main() {\n    for i in 1..\u003d1023 {\n        print!(\"N{:05} \u003d {:05}, \", i, i);\n        if i % 5 \u003d\u003d 0 { println!(); }\n    }\n}\n```\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7fa73026b737a2e7a5211ff43e1cf33cc6a4c591",
      "old_mode": 33188,
      "old_path": "core/platform/src/command_return.rs",
      "new_id": "9d8457294e34690c6774e9b10f8e8af26e7edc20",
      "new_mode": 33188,
      "new_path": "core/platform/src/command_return.rs"
    },
    {
      "type": "modify",
      "old_id": "1712f7142413e367506e98a9d17e33881c29d068",
      "old_mode": 33188,
      "old_path": "core/platform/src/command_return_tests.rs",
      "new_id": "439f9e78dd14ccc701d2deb437b2231f7f1d7945",
      "new_mode": 33188,
      "new_path": "core/platform/src/command_return_tests.rs"
    },
    {
      "type": "modify",
      "old_id": "63cc34e99b889cd1611586e8356520a37e86021a",
      "old_mode": 33188,
      "old_path": "core/platform/src/error_code.rs",
      "new_id": "276e70306991ed56637376c72d0b6e2d15200225",
      "new_mode": 33188,
      "new_path": "core/platform/src/error_code.rs"
    },
    {
      "type": "modify",
      "old_id": "45021ca35536bfc1a0ffa478e939577b03fc9036",
      "old_mode": 33188,
      "old_path": "core/platform/src/lib.rs",
      "new_id": "d57644bdd1ac3fdde1aa6723f9235d9be50d95a7",
      "new_mode": 33188,
      "new_path": "core/platform/src/lib.rs"
    }
  ]
}
