Nit: address various style nits

This commit is contained in:
Niko Matsakis 2016-04-26 13:06:28 -04:00
parent d5529f000d
commit f6496cd370
3 changed files with 10 additions and 5 deletions

View file

@ -131,6 +131,9 @@ pub struct EmitterWriter {
dst: Destination,
registry: Option<diagnostics::registry::Registry>,
cm: Rc<codemap::CodeMap>,
/// Is this the first error emitted thus far? If not, we emit a
/// `\n` before the top-level errors.
first: bool,
}
@ -172,7 +175,9 @@ impl EmitterWriter {
EmitterWriter { dst: dst, registry: registry, cm: code_map, first: true }
} else {
EmitterWriter { dst: Raw(Box::new(io::stderr())),
registry: registry, cm: code_map, first: true }
registry: registry,
cm: code_map,
first: true }
}
}

View file

@ -16,7 +16,6 @@ use std::rc::Rc;
use std::mem;
use std::ops::Range;
#[cfg(test)]
mod test;
pub struct SnippetData {
@ -210,8 +209,7 @@ impl<S> From<(S, Style, RenderedLineKind)> for RenderedLine
impl<S1,S2> From<(S1, Style, S2, Style, RenderedLineKind)> for RenderedLine
where S1: StringSource, S2: StringSource
{
fn from(tuple: (S1, Style, S2, Style, RenderedLineKind))
-> Self {
fn from(tuple: (S1, Style, S2, Style, RenderedLineKind)) -> Self {
let (text1, style1, text2, style2, kind) = tuple;
RenderedLine {
text: vec![

View file

@ -1,4 +1,4 @@
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@ -10,6 +10,8 @@
// Code for testing annotated snippets.
#![cfg(test)]
use codemap::{BytePos, CodeMap, FileMap, NO_EXPANSION, Span};
use std::rc::Rc;
use super::{RenderedLine, SnippetData};