parent
348aa4a585
commit
a6dfa54484
@ -1,67 +0,0 @@
|
|||||||
From f6a22b95f36f4918ed2f53a2920690ad8aec5bff Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
|
|
||||||
Date: Wed, 31 Jul 2019 22:11:03 +0200
|
|
||||||
Subject: [PATCH] Bump cargo_metadata to 0.8
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
|
|
||||||
---
|
|
||||||
Cargo.toml | 3 ++-
|
|
||||||
lib.rs | 14 +++++++++-----
|
|
||||||
2 files changed, 11 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/Cargo.toml b/Cargo.toml
|
|
||||||
index 57a07f4..33341a1 100644
|
|
||||||
--- a/Cargo.toml
|
|
||||||
+++ b/Cargo.toml
|
|
||||||
@@ -36,6 +36,9 @@ version = "0.8"
|
|
||||||
version = "0.12"
|
|
||||||
default-features = false
|
|
||||||
|
|
||||||
+[dependencies.failure]
|
|
||||||
+version = "0.1"
|
|
||||||
+
|
|
||||||
[dependencies.glob]
|
|
||||||
version = "0.3"
|
|
||||||
|
|
||||||
diff --git a/lib.rs b/lib.rs
|
|
||||||
index 08c0066..de24c98 100644
|
|
||||||
--- a/lib.rs
|
|
||||||
+++ b/lib.rs
|
|
||||||
@@ -1,5 +1,6 @@
|
|
||||||
#[macro_use]
|
|
||||||
extern crate error_chain;
|
|
||||||
+extern crate failure;
|
|
||||||
extern crate pulldown_cmark as cmark;
|
|
||||||
extern crate tempdir;
|
|
||||||
extern crate glob;
|
|
||||||
@@ -533,12 +534,14 @@ pub mod rt {
|
|
||||||
|
|
||||||
use self::walkdir::WalkDir;
|
|
||||||
use self::serde_json::Value;
|
|
||||||
+
|
|
||||||
+ use failure::ResultExt as _;
|
|
||||||
|
|
||||||
error_chain! {
|
|
||||||
errors { Fingerprint }
|
|
||||||
foreign_links {
|
|
||||||
Io(std::io::Error);
|
|
||||||
- Metadata(cargo_metadata::Error);
|
|
||||||
+ Metadata(failure::Compat<cargo_metadata::Error>);
|
|
||||||
Json(serde_json::Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -556,7 +559,7 @@ pub mod rt {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_cargo_meta<P: AsRef<Path>>(pth: P) -> Result<cargo_metadata::Metadata> {
|
|
||||||
- Ok(cargo_metadata::MetadataCommand::new().manifest_path(&pth).exec()?)
|
|
||||||
+ Ok(cargo_metadata::MetadataCommand::new().manifest_path(&pth).exec().compat()?)
|
|
||||||
}
|
|
||||||
|
|
||||||
impl LockedDeps {
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -0,0 +1,71 @@
|
|||||||
|
From 4c58547f971776f63db9f8735c67ca4178596449 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Igor Raits <i.gnatenko.brain@gmail.com>
|
||||||
|
Date: Sat, 22 Feb 2020 19:03:02 +0100
|
||||||
|
Subject: [PATCH 2/2] chore: Update pulldown-cmark to 0.7
|
||||||
|
|
||||||
|
Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
|
||||||
|
---
|
||||||
|
lib.rs | 12 ++++++------
|
||||||
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lib.rs b/lib.rs
|
||||||
|
index bcf59bd..f8d1295 100644
|
||||||
|
--- a/lib.rs
|
||||||
|
+++ b/lib.rs
|
||||||
|
@@ -11,7 +11,7 @@ use std::io::{self, Read, Write, Error as IoError};
|
||||||
|
use std::mem;
|
||||||
|
use std::path::{PathBuf, Path};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
-use cmark::{Parser, Event, Tag};
|
||||||
|
+use cmark::{Parser, Event, Tag, CodeBlockKind};
|
||||||
|
|
||||||
|
/// Returns a list of markdown files under a directory.
|
||||||
|
///
|
||||||
|
@@ -194,7 +194,7 @@ fn extract_tests_from_file(path: &Path) -> Result<DocTest, IoError> {
|
||||||
|
fn extract_tests_from_string(s: &str, file_stem: &str) -> (Vec<Test>, Option<String>) {
|
||||||
|
let mut tests = Vec::new();
|
||||||
|
let mut buffer = Buffer::None;
|
||||||
|
- let mut parser = Parser::new(s);
|
||||||
|
+ let parser = Parser::new(s);
|
||||||
|
let mut section = None;
|
||||||
|
let mut code_block_start = 0;
|
||||||
|
// Oh this isn't actually a test but a legacy template
|
||||||
|
@@ -212,7 +212,7 @@ fn extract_tests_from_string(s: &str, file_stem: &str) -> (Vec<Test>, Option<Str
|
||||||
|
section = Some(sanitize_test_name(§));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- Event::Start(Tag::CodeBlock(ref info)) => {
|
||||||
|
+ Event::Start(Tag::CodeBlock(CodeBlockKind::Fenced(ref info))) => {
|
||||||
|
let code_block_info = parse_code_block_info(info);
|
||||||
|
if code_block_info.is_rust {
|
||||||
|
buffer = Buffer::Code(Vec::new());
|
||||||
|
@@ -228,7 +228,7 @@ fn extract_tests_from_string(s: &str, file_stem: &str) -> (Vec<Test>, Option<Str
|
||||||
|
buf.push_str(&*text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- Event::End(Tag::CodeBlock(ref info)) => {
|
||||||
|
+ Event::End(Tag::CodeBlock(CodeBlockKind::Fenced(ref info))) => {
|
||||||
|
let code_block_info = parse_code_block_info(info);
|
||||||
|
if let Buffer::Code(buf) = mem::replace(&mut buffer, Buffer::None) {
|
||||||
|
if code_block_info.is_old_template {
|
||||||
|
@@ -277,7 +277,7 @@ fn load_templates(path: &Path) -> Result<HashMap<String, String>, IoError> {
|
||||||
|
|
||||||
|
for event in parser {
|
||||||
|
match event {
|
||||||
|
- Event::Start(Tag::CodeBlock(ref info)) => {
|
||||||
|
+ Event::Start(Tag::CodeBlock(CodeBlockKind::Fenced(ref info))) => {
|
||||||
|
let code_block_info = parse_code_block_info(info);
|
||||||
|
if code_block_info.is_rust {
|
||||||
|
code_buffer = Some(Vec::new());
|
||||||
|
@@ -288,7 +288,7 @@ fn load_templates(path: &Path) -> Result<HashMap<String, String>, IoError> {
|
||||||
|
buf.push(text.to_string());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- Event::End(Tag::CodeBlock(ref info)) => {
|
||||||
|
+ Event::End(Tag::CodeBlock(CodeBlockKind::Fenced(ref info))) => {
|
||||||
|
let code_block_info = parse_code_block_info(info);
|
||||||
|
if let Some(buf) = code_buffer.take() {
|
||||||
|
if let Some(t) = code_block_info.template {
|
||||||
|
--
|
||||||
|
2.25.0
|
||||||
|
|
Loading…
Reference in new issue