toml icon indicating copy to clipboard operation
toml copied to clipboard

Consider splitting `Decor` out of types

Open epage opened this issue 8 months ago • 0 comments

Right now, we have

  • Value::* which is Formatted which has Decor and Repr
  • Array which has Decor and Span
  • InlineTable which has Decor and Span
  • Key which has two Decors and Repr

This makes it annoying for operating on a Values decor because you have to handle every case differently. This also requires manual work to maintain the Decor when changing a Value.

Could have a pub Decoration type and pub Decorated<T>?

Would love to do something similar for Repr but we have to make sure that gets deleted when a Value is overwritten.

epage avatar May 02 '25 15:05 epage