From edfcda0d44d41f4860f112e542d95ea442944d86 Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Wed, 2 Dec 2020 10:56:46 -0800 Subject: [PATCH 1/3] ignore all io errors while resolving source files --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 16d2ea8..5225543 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -315,8 +315,8 @@ impl Frame<'_> { let file = match File::open(filename) { Ok(file) => file, - Err(ref e) if e.kind() == ErrorKind::NotFound => return Ok(()), - e @ Err(_) => e.unwrap(), + // ignore io errors and just don't print the source + Err(_) => return Ok(()), }; use std::fmt::Write; From 804992769c552f54588c703d86fc179bf13399cb Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Wed, 2 Dec 2020 11:05:06 -0800 Subject: [PATCH 2/3] prep for release --- CHANGELOG.md | 8 +++++++- Cargo.toml | 3 +++ src/lib.rs | 2 +- tests/themes.rs | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e4c665..a647a43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - ReleaseDate +### Fixed +- Ignore all io errors when resolving source files instead of only file not + found errors + +## [v0.1.5] - 2020-12-01 ### Added - Support custom color themes for spantrace format -[Unreleased]: https://github.com/yaahc/color-spantrace/releases/tag/v0.1.5 +[Unreleased]: https://github.com/yaahc/color-spantrace/compare/v0.1.5...HEAD +[v0.1.5]: https://github.com/yaahc/color-spantrace/releases/tag/v0.1.5 diff --git a/Cargo.toml b/Cargo.toml index 49a10e9..f8b815e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,9 @@ ansi-parser = "0.6.5" # used for testing color schemes all-features = true rustdoc-args = ["--cfg", "docsrs"] +[package.metadata.release] +no-dev-version = true + [[package.metadata.release.pre-release-replacements]] file = "CHANGELOG.md" search = "Unreleased" diff --git a/src/lib.rs b/src/lib.rs index 5225543..75be4cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,7 +88,7 @@ use owo_colors::{style, Style}; use std::env; use std::fmt; use std::fs::File; -use std::io::{BufRead, BufReader, ErrorKind}; +use std::io::{BufRead, BufReader}; use tracing_error::SpanTrace; static THEME: OnceCell = OnceCell::new(); diff --git a/tests/themes.rs b/tests/themes.rs index 53c9018..21bdae0 100644 --- a/tests/themes.rs +++ b/tests/themes.rs @@ -40,6 +40,7 @@ use tracing_error::SpanTrace; use tracing_subscriber::{prelude::*, registry::Registry}; #[instrument] +#[allow(clippy::clippy::if_same_then_else)] fn test_capture(x: u8) -> SpanTrace { if x == 42 { SpanTrace::capture() From 2eebd849503cfcb5155f45649104fa2c42fb607a Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Wed, 2 Dec 2020 11:07:20 -0800 Subject: [PATCH 3/3] (cargo-release) version 0.1.6 --- CHANGELOG.md | 5 ++++- Cargo.toml | 2 +- src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a647a43..a7f8513 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - ReleaseDate + +## [0.1.6] - 2020-12-02 ### Fixed - Ignore all io errors when resolving source files instead of only file not found errors @@ -16,5 +18,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support custom color themes for spantrace format -[Unreleased]: https://github.com/yaahc/color-spantrace/compare/v0.1.5...HEAD +[Unreleased]: https://github.com/yaahc/color-spantrace/compare/v0.1.6...HEAD +[0.1.6]: https://github.com/yaahc/color-spantrace/compare/v0.1.5...v0.1.6 [v0.1.5]: https://github.com/yaahc/color-spantrace/releases/tag/v0.1.5 diff --git a/Cargo.toml b/Cargo.toml index f8b815e..6f692db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "color-spantrace" -version = "0.1.6-alpha.0" +version = "0.1.6" authors = ["Jane Lusby "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/src/lib.rs b/src/lib.rs index 75be4cb..81ddee3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,7 +59,7 @@ //! //! [`tracing_error::SpanTrace`]: https://docs.rs/tracing-error/*/tracing_error/struct.SpanTrace.html //! [`color-backtrace`]: https://github.com/athre0z/color-backtrace -#![doc(html_root_url = "https://docs.rs/color-spantrace/0.1.4")] +#![doc(html_root_url = "https://docs.rs/color-spantrace/0.1.6")] #![warn( missing_debug_implementations, missing_docs,