{"record":{"id":"8a8c7fa74099b6a7","repo":"a-b-street/abstreet","slug":"not-a-lane","errorCode":null,"errorMessage":"not a lane","messagePattern":"not a lane","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"map_model/src/traversable.rs","lineNumber":157,"sourceCode":"impl Traversable {\n    pub fn as_lane(&self) -> LaneID {\n        match *self {\n            Traversable::Lane(id) => id,\n            Traversable::Turn(_) => panic!(\"not a lane\"),\n        }\n    }\n\n    pub fn as_turn(&self) -> TurnID {\n        match *self {\n            Traversable::Turn(id) => id,\n            Traversable::Lane(_) => panic!(\"not a turn\"),\n        }\n    }","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/map_model/src/traversable.rs#L139-L175","documentation":"Generic unwrapping helper on the Traversable enum: as_lane asserts the variant is Lane and this panic fires when a caller calls as_lane on a Traversable::Turn. The input at fault is the Traversable value itself — the caller should have used maybe_lane or matched on the enum first.","triggerScenarios":"Thrown at map_model/src/traversable.rs:157 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use maybe_lane() and handle the None case instead of as_lane","Match on the Traversable enum explicitly at the call site","Fix the caller's logic so it only holds lane traversables when calling as_lane"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}