Remove some superfluous type bounds

This commit is contained in:
Brendan Zabarauskas
2020-02-19 13:24:18 +11:00
parent 2787eaa5b5
commit cb451607ef
3 changed files with 5 additions and 20 deletions
@@ -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)>,
+2 -8
View File
@@ -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.