denoland / deno_ast

Source text parsing, lexing, and AST related functionality for Deno
https://crates.io/crates/deno_ast
MIT License
146 stars 45 forks source link

refactor(diagnostics): use `Cow<str>` instead of `impl Display` #207

Closed dsherret closed 7 months ago

dsherret commented 7 months ago

This works better with Cow for when a diagnostic contains a diagnostic that returns these methods from the inner diagnostic. With impl Display you need to convert everything into a known concrete type on the outer diagnostic (ex. call to_string() on everything).