greyblake / nutype

Rust newtype with guarantees πŸ‡ΊπŸ‡¦ πŸ¦€
MIT License
1.42k stars 23 forks source link

Rust-analyzer lsp server now gives me macro error #175

Closed miseyu closed 3 months ago

miseyu commented 3 months ago

Overview

unexpected token rust-analyzer[macro-error](https://rust-analyzer.github.io/manual.html#macro-error)
#[nutype::nutype(
    sanitize(trim),
    derive(
        Debug,
        Clone,
        Eq,
        PartialEq,
        PartialOrd,
        Ord,
        AsRef,
        Serialize,
        Deserialize,
        Hash,
        Display,
        JsonSchema,
    )
)]
pub(super) struct EdgeId(String);

Removing the JsonSchema derive from the above resolves the problem, so there must be some problem at the JsonSchema point.

miseyu commented 3 months ago

This one was not a problem with nutype, but with https://github.com/GREsau/schemars, so I will close it.