Neotenic Primate
Neotenic Primate

Reputation: 363

Neo4rs BoltType Float f64

I am using Neo4rs and I'm having troubles with floats. The following code

let mut result = graph.execute(
            query("CREATE (p:PERSON {height: $height}) RETURN p")
                .param("height", person.height)

Where person.height is a f64, will not compile due to

the trait bound `neo4rs::types::BoltType: std::convert::From<f64>` is not satisfied

Although, when I look at the repo, it does seem like it is implemented. I've been converting floats to strings and then back to floats but I think I am missing something obvious.

Upvotes: 0

Views: 173

Answers (1)

Masklinn
Masklinn

Reputation: 42502

Although, when I look at the repo, it does seem like it is implemented.

Where do you see that? Because all I can see is a way to convert from BoltType to f64 (so get f64 out of bolt I guess), not from f64 into BoltType.

In fact there is an open PR which wants to add an f64->BoltType conversion (alongside conversion of BoltType from and into Vec).

Upvotes: 0

Related Questions