projectfluent / fluent-rs

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

fluent_args documentation is unclear #135

Closed cmyr closed 5 years ago

cmyr commented 5 years ago

The code in the docs for fluent_args! won't compile as written.

The following program, with fluent = "0.7" in the manifest:

use fluent::fluent_args;

fn main() {
    let mut args = fluent_args![
        "name" => "John",
        "emailCount" => 5
    ];
}

produces the error,

error[E0433]: failed to resolve: could not find `fluent_bundle` in `{{root}}`
 --> src/main.rs:6:16
  |
6 |   let mut args = fluent_args![
  |  ________________^
7 | |     "name" => "John",
8 | |     "emailCount" => 5
9 | | ];
  | |_^ could not find `fluent_bundle` in `{{root}}`
  |
  = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

This is resolved if I explicitly add fluent-bundle to my manifest, but this is confusing, since the macro is only exposed in the fluent crate, and it would be nice if I only needed to provide the one dependency.

Pike commented 5 years ago

That's #132, right? That's waiting to be released, though.

zbraniecki commented 5 years ago

yep, will release 0.7.1 tomorrow!

cmyr commented 5 years ago

Cool, thanks!