From 66f22e550b2fc12deb63a6a56b599dffb267785b Mon Sep 17 00:00:00 2001 From: David Wood Date: Sun, 3 Apr 2022 04:58:57 +0100 Subject: [PATCH] errors: use `impl Into` `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 --- compiler/rustc_error_messages/src/lib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index 508d419cdb6..1b8267524af 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -219,15 +219,12 @@ impl DiagnosticMessage { } /// Create a `DiagnosticMessage` for the provided Fluent identifier. - pub fn fluent(id: impl Into>) -> Self { + pub fn fluent(id: impl Into) -> Self { DiagnosticMessage::FluentIdentifier(id.into(), None) } /// Create a `DiagnosticMessage` for the provided Fluent identifier and attribute. - pub fn fluent_attr( - id: impl Into>, - attr: impl Into>, - ) -> Self { + pub fn fluent_attr(id: impl Into, attr: impl Into) -> Self { DiagnosticMessage::FluentIdentifier(id.into(), Some(attr.into())) } }