Skip to content

Commit 1154408

Browse files
committed
Anonymized example. Tiny style tweak.
1 parent e77d4ba commit 1154408

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fluent/src/bundle.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ pub struct Message {
3636
/// bundle.add_messages("intro = Welcome, { $name }.");
3737
///
3838
/// let mut args = HashMap::new();
39-
/// args.insert("name", FluentValue::from("John"));
39+
/// args.insert("name", FluentValue::from("Rustacean"));
4040
///
4141
/// let value = bundle.format("intro", Some(&args));
42-
/// assert_eq!(value, Some(("Welcome, John.".to_string(), vec![])));
42+
/// assert_eq!(value, Some(("Welcome, Rustacean.".to_string(), vec![])));
4343
///
4444
/// ```
4545
///
@@ -149,7 +149,7 @@ impl<'bundle> FluentBundle<'bundle> {
149149
/// let mut bundle = FluentBundle::new(&["en-US"]);
150150
///
151151
/// // Register a fn that maps from string to string length
152-
/// bundle.add_function("STRLEN", |positional, named| match positional {
152+
/// bundle.add_function("STRLEN", |positional, _named| match positional {
153153
/// [Some(FluentValue::String(str))] => Some(FluentValue::Number(str.len().to_string())),
154154
/// _ => None,
155155
/// }).unwrap();
@@ -272,10 +272,10 @@ impl<'bundle> FluentBundle<'bundle> {
272272
/// bundle.add_messages("intro = Welcome, { $name }.");
273273
///
274274
/// let mut args = HashMap::new();
275-
/// args.insert("name", FluentValue::from("John"));
275+
/// args.insert("name", FluentValue::from("Rustacean"));
276276
///
277277
/// let value = bundle.format("intro", Some(&args));
278-
/// assert_eq!(value, Some(("Welcome, John.".to_string(), vec![])));
278+
/// assert_eq!(value, Some(("Welcome, Rustacean.".to_string(), vec![])));
279279
///
280280
/// ```
281281
///

0 commit comments

Comments
 (0)