nodecosmos / charybdis

Rust ORM for ScyllaDB and Apache Cassandra
MIT License
128 stars 8 forks source link

Putting semi-colon in doc comments in models causes the macro to panic #45

Open Zk2u opened 3 months ago

Zk2u commented 3 months ago

Let's say we have the following.

#[charybdis_model(
    table_name = chefs,
    partition_keys = [id],
    clustering_keys = [],
    global_secondary_indexes = [email, phone],
    local_secondary_indexes = [],
    static_columns = []
)]
#[derive(Default, Serialize, Deserialize)]
pub struct Chef {
    /// Chef's unique; identifier. Immutable
    pub id: Uuid,
    pub email: Text,
    pub phone: Text,
}

The semi-colon in the doc comment for id will cause the charybdis_model to crash.

custom attribute panicked
message: called `Result::unwrap()` on an `Err` value: Error("cannot parse string into token stream")