mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
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:
parent
3c2f864ffb
commit
66f22e550b
@ -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()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user