errors: remove diagnostic message ctors
Now that typed identifiers are used in both derives, constructors for the `DiagnosticMessage` and `SubdiagnosticMessage` types are not required. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
abd3467d47
commit
dc90d1d987
@ -258,18 +258,6 @@ pub enum SubdiagnosticMessage {
|
||||
FluentAttr(FluentId),
|
||||
}
|
||||
|
||||
impl SubdiagnosticMessage {
|
||||
/// Create a `SubdiagnosticMessage` for the provided Fluent attribute.
|
||||
pub fn attr(id: impl Into<FluentId>) -> Self {
|
||||
SubdiagnosticMessage::FluentAttr(id.into())
|
||||
}
|
||||
|
||||
/// Create a `SubdiagnosticMessage` for the provided Fluent identifier.
|
||||
pub fn message(id: impl Into<FluentId>) -> Self {
|
||||
SubdiagnosticMessage::FluentIdentifier(id.into())
|
||||
}
|
||||
}
|
||||
|
||||
/// `From` impl that enables existing diagnostic calls to functions which now take
|
||||
/// `impl Into<SubdiagnosticMessage>` to continue to work as before.
|
||||
impl<S: Into<String>> From<S> for SubdiagnosticMessage {
|
||||
@ -332,11 +320,6 @@ pub fn expect_str(&self) -> &str {
|
||||
_ => panic!("expected non-translatable diagnostic message"),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a `DiagnosticMessage` for the provided Fluent identifier.
|
||||
pub fn new(id: impl Into<FluentId>) -> Self {
|
||||
DiagnosticMessage::FluentIdentifier(id.into(), None)
|
||||
}
|
||||
}
|
||||
|
||||
/// `From` impl that enables existing diagnostic calls to functions which now take
|
||||
|
Loading…
Reference in New Issue
Block a user