Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>epel9
parent
221f7590ac
commit
101a0a5758
@ -0,0 +1,80 @@
|
||||
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 {
|
||||
@@ -569,9 +572,10 @@ pub mod rt {
|
||||
.into_iter()
|
||||
.filter(|node| workspace_members.contains(&node.id))
|
||||
.flat_map(|node| node.dependencies.into_iter())
|
||||
- .chain(workspace_members.clone());
|
||||
+ .chain(workspace_members.clone())
|
||||
+ .map(|x| x.to_string());
|
||||
|
||||
- Ok(LockedDeps { dependencies: deps.map(|node| node.repr ).collect() })
|
||||
+ Ok(LockedDeps { dependencies: deps.collect() })
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,29 @@
|
||||
From fa0c0491ed29d8b8006e9ebfc0c8dae0f3be285f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
|
||||
Date: Thu, 1 Aug 2019 00:18:55 +0200
|
||||
Subject: [PATCH] Bump pulldown-cmark to 0.5
|
||||
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>
|
||||
---
|
||||
src/skeptic/lib.rs | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/lib.rs b/lib.rs
|
||||
index 08c0066..b9a4eb7 100644
|
||||
--- a/lib.rs
|
||||
+++ b/lib.rs
|
||||
@@ -231,7 +231,7 @@ fn extract_tests_from_string(s: &str, file_stem: &str) -> (Vec<Test>, Option<Str
|
||||
if buf.is_empty() {
|
||||
code_block_start = line_number;
|
||||
}
|
||||
- buf.push(text.into_owned());
|
||||
+ buf.extend(text.lines().map(|s| format!("{}\n", s)));
|
||||
} else if let Buffer::Header(ref mut buf) = buffer {
|
||||
buf.push_str(&*text);
|
||||
}
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,64 @@
|
||||
From 765ec44a41410de6190af2067b3f1f9ca1dc170e Mon Sep 17 00:00:00 2001
|
||||
From: Michal Budzynski <budziq@gmail.com>
|
||||
Date: Thu, 14 Mar 2019 10:23:11 +0100
|
||||
Subject: [PATCH] Bumped glob and cargo_metadata to latest version
|
||||
|
||||
bumped minimal rust version to 1.26 due to usage of underscore lifetimes in cargo_metadata
|
||||
---
|
||||
lib.rs | 19 ++++++++++---------
|
||||
1 files changed, 10 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/lib.rs b/lib.rs
|
||||
index b24c5a2..2f47049 100644
|
||||
--- a/lib.rs
|
||||
+++ b/lib.rs
|
||||
@@ -38,7 +38,7 @@ pub fn markdown_files_of_directory(dir: &str) -> Vec<PathBuf> {
|
||||
};
|
||||
let mut out = Vec::new();
|
||||
|
||||
- for path in glob_with(&format!("{}/**/*.md", dir), &opts)
|
||||
+ for path in glob_with(&format!("{}/**/*.md", dir), opts)
|
||||
.expect("Failed to read glob pattern")
|
||||
.filter_map(Result::ok)
|
||||
{
|
||||
@@ -549,14 +549,15 @@ pub mod rt {
|
||||
dependencies: Vec<String>,
|
||||
}
|
||||
|
||||
+ fn get_cargo_meta<P: AsRef<Path>>(pth: P) -> Result<cargo_metadata::Metadata> {
|
||||
+ Ok(cargo_metadata::MetadataCommand::new().manifest_path(&pth).exec()?)
|
||||
+ }
|
||||
+
|
||||
impl LockedDeps {
|
||||
fn from_path<P: AsRef<Path>>(pth: P) -> Result<LockedDeps> {
|
||||
let pth = pth.as_ref().join("Cargo.toml");
|
||||
- let metadata = cargo_metadata::metadata_deps(Some(&pth), true)?;
|
||||
- let workspace_members:Vec<String> = metadata.workspace_members
|
||||
- .into_iter()
|
||||
- .map(|workspace| {format!("{} {} ({})", workspace.name(), workspace.version(), workspace.url())})
|
||||
- .collect();
|
||||
+ let metadata = get_cargo_meta(&pth)?;
|
||||
+ let workspace_members = metadata.workspace_members;
|
||||
let deps = metadata.resolve.ok_or("Missing dependency metadata")?
|
||||
.nodes
|
||||
.into_iter()
|
||||
@@ -564,7 +565,7 @@ pub mod rt {
|
||||
.flat_map(|node| node.dependencies.into_iter())
|
||||
.chain(workspace_members.clone());
|
||||
|
||||
- Ok(LockedDeps { dependencies: deps.collect() })
|
||||
+ Ok(LockedDeps { dependencies: deps.map(|node| node.repr ).collect() })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -655,8 +656,8 @@ pub mod rt {
|
||||
|
||||
fn get_edition<P: AsRef<Path>>(path: P) -> Result<String> {
|
||||
let path = path.as_ref().join("Cargo.toml");
|
||||
- let manifest = cargo_metadata::metadata(Some(&path))?;
|
||||
- let edition = manifest.packages.iter()
|
||||
+ let metadata = get_cargo_meta(&path)?;
|
||||
+ let edition = metadata.packages.iter()
|
||||
.map(|package| &package.edition)
|
||||
.max_by_key(|edition| u64::from_str(edition).unwrap())
|
||||
.unwrap()
|
Loading…
Reference in new issue