errors: use impl Into<FluentId>

`FluentId` is the type alias that is used everywhere else so it should
be used here too so that this doesn't need updated if the alias changes.

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-04-03 04:58:57 +01:00
parent 3c2f864ffb
commit 66f22e550b

View File

@ -219,15 +219,12 @@ impl DiagnosticMessage {
} }
/// Create a `DiagnosticMessage` for the provided Fluent identifier. /// Create a `DiagnosticMessage` for the provided Fluent identifier.
pub fn fluent(id: impl Into<Cow<'static, str>>) -> Self { pub fn fluent(id: impl Into<FluentId>) -> Self {
DiagnosticMessage::FluentIdentifier(id.into(), None) DiagnosticMessage::FluentIdentifier(id.into(), None)
} }
/// Create a `DiagnosticMessage` for the provided Fluent identifier and attribute. /// Create a `DiagnosticMessage` for the provided Fluent identifier and attribute.
pub fn fluent_attr( pub fn fluent_attr(id: impl Into<FluentId>, attr: impl Into<FluentId>) -> Self {
id: impl Into<Cow<'static, str>>,
attr: impl Into<Cow<'static, str>>,
) -> Self {
DiagnosticMessage::FluentIdentifier(id.into(), Some(attr.into())) DiagnosticMessage::FluentIdentifier(id.into(), Some(attr.into()))
} }
} }