I am struggling with rustfmt. I have code which is matching against
long literals. A single match arm might look like this:
[[_, Term::OWL(VOWL::OnDatatype), Term::Iri(iri)],
[_, Term::OWL(VOWL::WithRestrictions), Term::BNode(id)],
[_, Term::RDF(VRDF::Type), Term::RDFS(VRDFS::Datatype)]] =>
Rustfmt turns it into this:
[[_, Term::OWL(VOWL::OnDatatype), Term::Iri(iri)], [_, Term::OWL(VOWL::WithRestrictions), Term::BNode(id)], [_, Term::RDF(VRDF::Type), Term::RDFS(VRDFS::Datatype)]] =>
Which is both unreadable and very, very long (one of my lines ends up
at 216 lines long).
I have tried judicious use of rustfmt::skip, but I have to put this on
the whole match expression; as these match expressions make up most of
the file, this is a bit pointless.
I also tried trailing comments like so:
[[_, Term::OWL(VOWL::OnDatatype), Term::Iri(iri)],\\
[_, Term::OWL(VOWL::WithRestrictions), Term::BNode(id)],\\
[_, Term::RDF(VRDF::Type), Term::RDFS(VRDFS::Datatype)]] =>
which I have heard given as an solution. But this fails to compile --
comments are not accepted at this point, which I am rather surprised
about to be honest.
Any thoughts welcome.