mirror of
https://github.com/openharmony/third_party_rust_codespan.git
synced 2026-07-21 03:55:28 -04:00
Remove some superfluous type bounds
This commit is contained in:
@@ -9,10 +9,7 @@ use crate::term::Config;
|
||||
use super::{Header, Locus, NewLine, SourceSnippet};
|
||||
|
||||
/// Output a richly formatted diagnostic, with source code previews.
|
||||
pub struct RichDiagnostic<'a, Source>
|
||||
where
|
||||
Source: AsRef<str>,
|
||||
{
|
||||
pub struct RichDiagnostic<'a, Source> {
|
||||
files: &'a Files<Source>,
|
||||
diagnostic: &'a Diagnostic,
|
||||
}
|
||||
@@ -70,10 +67,7 @@ where
|
||||
}
|
||||
|
||||
/// Output a short diagnostic, with a line number, severity, and message.
|
||||
pub struct ShortDiagnostic<'a, Source>
|
||||
where
|
||||
Source: AsRef<str>,
|
||||
{
|
||||
pub struct ShortDiagnostic<'a, Source> {
|
||||
files: &'a Files<Source>,
|
||||
diagnostic: &'a Diagnostic,
|
||||
}
|
||||
|
||||
@@ -31,10 +31,7 @@ pub use self::underline::MarkStyle;
|
||||
/// = expected type `Int`
|
||||
/// found type `String`
|
||||
/// ```
|
||||
pub struct SourceSnippet<'a, Source>
|
||||
where
|
||||
Source: AsRef<str>,
|
||||
{
|
||||
pub struct SourceSnippet<'a, Source> {
|
||||
files: &'a Files<Source>,
|
||||
file_id: FileId,
|
||||
spans: Vec<(&'a Label, MarkStyle)>,
|
||||
|
||||
@@ -96,10 +96,7 @@ impl FileId {
|
||||
/// [`Rc<str>`]: std::rc::Rc
|
||||
/// [`Arc<str>`]: std::sync::Arc
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Files<Source>
|
||||
where
|
||||
Source: AsRef<str>,
|
||||
{
|
||||
pub struct Files<Source> {
|
||||
files: Vec<File<Source>>,
|
||||
}
|
||||
|
||||
@@ -282,10 +279,7 @@ where
|
||||
/// A file that is stored in the database.
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serialization", derive(Deserialize, Serialize))]
|
||||
struct File<Source>
|
||||
where
|
||||
Source: AsRef<str>,
|
||||
{
|
||||
struct File<Source> {
|
||||
/// The name of the file.
|
||||
name: OsString,
|
||||
/// The source code of the file.
|
||||
|
||||
Reference in New Issue
Block a user