Rollup merge of #136251 - hkBst:opt_imports, r=estebank

use impl Into<String> instead of explicit type args with bounds
This commit is contained in:
Matthias Krüger 2025-01-30 12:45:38 +01:00 committed by GitHub
commit 9b7af17d5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -363,12 +363,7 @@ impl<'a> Parser<'a> {
/// Notifies of an error. The message doesn't actually need to be of type /// Notifies of an error. The message doesn't actually need to be of type
/// String, but I think it does when this eventually uses conditions so it /// String, but I think it does when this eventually uses conditions so it
/// might as well start using it now. /// might as well start using it now.
fn err<S1: Into<String>, S2: Into<String>>( fn err(&mut self, description: impl Into<String>, label: impl Into<String>, span: InnerSpan) {
&mut self,
description: S1,
label: S2,
span: InnerSpan,
) {
self.errors.push(ParseError { self.errors.push(ParseError {
description: description.into(), description: description.into(),
note: None, note: None,
@ -382,11 +377,11 @@ impl<'a> Parser<'a> {
/// Notifies of an error. The message doesn't actually need to be of type /// Notifies of an error. The message doesn't actually need to be of type
/// String, but I think it does when this eventually uses conditions so it /// String, but I think it does when this eventually uses conditions so it
/// might as well start using it now. /// might as well start using it now.
fn err_with_note<S1: Into<String>, S2: Into<String>, S3: Into<String>>( fn err_with_note(
&mut self, &mut self,
description: S1, description: impl Into<String>,
label: S2, label: impl Into<String>,
note: S3, note: impl Into<String>,
span: InnerSpan, span: InnerSpan,
) { ) {
self.errors.push(ParseError { self.errors.push(ParseError {