{
    "Function": "closestBitRight",
    "File": "src/libraries/BitMath.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [
        "mostSignificantBit"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function closestBitRight(uint256 x, uint8 bit) internal pure returns (uint256 id) {\n        unchecked {\n            uint256 _shift = 255 - bit;\n            x <<= _shift;\n\n            if (x == 0) return type(uint256).max;\n\n            // can't overflow as it's non-zero and we shifted it by `_shift`\n            return mostSignificantBit(x) - _shift;\n        }\n    }"
}