Skip to content

Commit

Permalink
Merge 45d8abb into c91d9f4
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuTricoire committed Oct 13, 2022
2 parents c91d9f4 + 45d8abb commit f222e48
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fluent-bundle/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,15 @@ impl<'source> From<Cow<'source, str>> for FluentValue<'source> {
FluentValue::String(s)
}
}

impl<'source, T> From<Option<T>> for FluentValue<'source>
where
T: Into<FluentValue<'source>>,
{
fn from(v: Option<T>) -> Self {
match v {
Some(v) => v.into(),
None => FluentValue::None,
}
}
}

0 comments on commit f222e48

Please sign in to comment.