projectfluent / fluent-rs

Rust implementation of Project Fluent
https://projectfluent.org
Apache License 2.0
1.04k stars 95 forks source link

Fix FluentValue::try_number accepting numbers #306

Closed JasperDeSutter closed 1 year ago

JasperDeSutter commented 1 year ago

This seems to be a mistake since the documentation only describes its use for parsing strings. By only accepting &str, there's no need for the to_string() call, making it more efficient. (AsRef is also an option) Note that this would be a breaking change since it's a public API.