about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-04-03 04:58:57 +0100
committerDavid Wood <david.wood@huawei.com>2022-04-05 07:01:03 +0100
commit66f22e550b2fc12deb63a6a56b599dffb267785b (patch)
tree99741d380c32a3bb202faf4bbdd0727124e0980a
parent3c2f864ffbf0e3d01f3f684acbd0ee602619bf19 (diff)
downloadrust-66f22e550b2fc12deb63a6a56b599dffb267785b.tar.gz
rust-66f22e550b2fc12deb63a6a56b599dffb267785b.zip
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>
-rw-r--r--compiler/rustc_error_messages/src/lib.rs7
1 files 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<Cow<'static, str>>) -> Self {
+    pub fn fluent(id: impl Into<FluentId>) -> Self {
         DiagnosticMessage::FluentIdentifier(id.into(), None)
     }
 
     /// Create a `DiagnosticMessage` for the provided Fluent identifier and attribute.
-    pub fn fluent_attr(
-        id: impl Into<Cow<'static, str>>,
-        attr: impl Into<Cow<'static, str>>,
-    ) -> Self {
+    pub fn fluent_attr(id: impl Into<FluentId>, attr: impl Into<FluentId>) -> Self {
         DiagnosticMessage::FluentIdentifier(id.into(), Some(attr.into()))
     }
 }