Skip to content

Commit 39e4de9

Browse files
committed
annotate-snippets 0.6.1
1 parent 860899e commit 39e4de9

13 files changed

+14
-36
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
## Unreleased
44

55
-
6+
7+
## annotate-snippets 0.6.1 (July 23, 2019)
8+
9+
- Fix too many anonymized line numbers (#5)
610

711
## annotate-snippets 0.6.0 (June 26, 2019)
812

Cargo.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "annotate-snippets"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
edition = "2018"
55
authors = ["Zibi Braniecki <[email protected]>"]
66
description = "Library for building code annotations"
@@ -21,10 +21,9 @@ ansi_term = { version = "0.11.0", optional = true }
2121
[dev-dependencies]
2222
glob = "^0.3"
2323
serde_yaml = "^0.8"
24-
serde = "^1.0"
25-
serde_derive = "^1.0"
24+
serde = { version = "^1.0", features = ["derive"] }
2625
difference = "^2.0"
27-
ansi_term = "^0.11"
26+
ansi_term = "^0.12"
2827

2928
[features]
3029
default = []

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ Usage
3434
-----
3535

3636
```rust
37-
extern crate annotate_snippets;
38-
3937
use annotate_snippets::snippet;
4038

4139
fn main() {

examples/expected_type.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate annotate_snippets;
2-
31
use annotate_snippets::display_list::DisplayList;
42
use annotate_snippets::formatter::DisplayListFormatter;
53
use annotate_snippets::snippet::{Annotation, AnnotationType, Slice, Snippet, SourceAnnotation};

examples/footer.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate annotate_snippets;
2-
31
use annotate_snippets::display_list::DisplayList;
42
use annotate_snippets::formatter::DisplayListFormatter;
53
use annotate_snippets::snippet::{Annotation, AnnotationType, Slice, Snippet, SourceAnnotation};

examples/format.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate annotate_snippets;
2-
31
use annotate_snippets::display_list::DisplayList;
42
use annotate_snippets::formatter::DisplayListFormatter;
53
use annotate_snippets::snippet::{Annotation, AnnotationType, Slice, Snippet, SourceAnnotation};

examples/multislice.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate annotate_snippets;
2-
31
use annotate_snippets::display_list::DisplayList;
42
use annotate_snippets::formatter::DisplayListFormatter;
53
use annotate_snippets::snippet::{Annotation, AnnotationType, Slice, Snippet};

src/stylesheets/color.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ impl Style for AnsiTermStyleWrapper {
1212
format!("{}", self.style.paint(text))
1313
}
1414

15-
fn bold(&self) -> Box<Style> {
15+
fn bold(&self) -> Box<dyn Style> {
1616
Box::new(AnsiTermStyleWrapper {
1717
style: self.style.clone(),
1818
})
@@ -22,7 +22,7 @@ impl Style for AnsiTermStyleWrapper {
2222
pub struct AnsiTermStylesheet {}
2323

2424
impl Stylesheet for AnsiTermStylesheet {
25-
fn get_style(&self, class: StyleClass) -> Box<Style> {
25+
fn get_style(&self, class: StyleClass) -> Box<dyn Style> {
2626
let ansi_term_style = match class {
2727
StyleClass::Error => Fixed(9).bold(),
2828
StyleClass::Warning => Fixed(11).bold(),

tests/diff/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
extern crate ansi_term;
2-
extern crate difference;
3-
4-
use self::ansi_term::Color::{Black, Green, Red};
5-
use self::difference::{Changeset, Difference};
1+
use ansi_term::Color::{Black, Green, Red};
2+
use difference::{Changeset, Difference};
63

74
pub fn get_diff(left: &str, right: &str) -> String {
85
let mut output = String::new();

tests/dl_from_snippet.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate annotate_snippets;
2-
31
use annotate_snippets::display_list as dl;
42
use annotate_snippets::snippet;
53

tests/fixtures.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
mod diff;
22
mod snippet;
33

4-
extern crate annotate_snippets;
5-
extern crate glob;
6-
#[macro_use]
7-
extern crate serde_derive;
8-
extern crate serde_yaml;
9-
104
use crate::snippet::SnippetDef;
115
use annotate_snippets::display_list::DisplayList;
126
use annotate_snippets::formatter::DisplayListFormatter;
@@ -17,6 +11,7 @@ use std::fs::File;
1711
use std::io;
1812
use std::io::prelude::*;
1913
use std::path::Path;
14+
use serde::Deserialize;
2015

2116
fn read_file(path: &str) -> Result<String, io::Error> {
2217
let mut f = File::open(path)?;

tests/formatter.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate annotate_snippets;
2-
31
use annotate_snippets::display_list::*;
42
use annotate_snippets::formatter::DisplayListFormatter;
53

tests/snippet/mod.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
extern crate annotate_snippets;
2-
extern crate serde;
1+
use serde::{Serialize, Deserialize, Deserializer};
32

4-
use self::serde::de::{Deserialize, Deserializer};
5-
6-
use self::annotate_snippets::snippet::{
3+
use annotate_snippets::snippet::{
74
Annotation, AnnotationType, Slice, Snippet, SourceAnnotation,
85
};
96

0 commit comments

Comments
 (0)