Skip to content

Commit 66f22e5

Browse files
committed
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 <[email protected]>
1 parent 3c2f864 commit 66f22e5

File tree

1 file changed

+2
-5
lines changed
  • compiler/rustc_error_messages/src

1 file changed

+2
-5
lines changed

compiler/rustc_error_messages/src/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,12 @@ impl DiagnosticMessage {
219219
}
220220

221221
/// Create a `DiagnosticMessage` for the provided Fluent identifier.
222-
pub fn fluent(id: impl Into<Cow<'static, str>>) -> Self {
222+
pub fn fluent(id: impl Into<FluentId>) -> Self {
223223
DiagnosticMessage::FluentIdentifier(id.into(), None)
224224
}
225225

226226
/// Create a `DiagnosticMessage` for the provided Fluent identifier and attribute.
227-
pub fn fluent_attr(
228-
id: impl Into<Cow<'static, str>>,
229-
attr: impl Into<Cow<'static, str>>,
230-
) -> Self {
227+
pub fn fluent_attr(id: impl Into<FluentId>, attr: impl Into<FluentId>) -> Self {
231228
DiagnosticMessage::FluentIdentifier(id.into(), Some(attr.into()))
232229
}
233230
}

0 commit comments

Comments
 (0)