Skip to content

Commit f23956e

Browse files
authored
add codecov to ci workflow (#118)
* add codecov to ci workflow * clippy
1 parent 236db4a commit f23956e

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ jobs:
5050
- uses: actions/checkout@v3
5151
- uses: dtolnay/rust-toolchain@stable
5252
- run: cargo test --features=plotly_ndarray,kaleido
53+
54+
code-coverage:
55+
name: Code Coverage
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v3
59+
- uses: dtolnay/rust-toolchain@stable
60+
with:
61+
components: llvm-tools-preview
62+
- uses: taiki-e/install-action@cargo-llvm-cov
63+
- run: cargo llvm-cov --workspace --lcov --output-path lcov.info
64+
- uses: codecov/codecov-action@v3
5365

5466
build_examples:
5567
name: Build Examples

plotly/src/plot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ impl Plot {
445445
fn show_with_default_app(temp_path: &str) {
446446
use std::process::Command;
447447
Command::new("xdg-open")
448-
.args(&[temp_path])
448+
.args([temp_path])
449449
.output()
450450
.expect(DEFAULT_HTML_APP_NOT_FOUND);
451451
}

plotly_derive/src/field_setter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fn _type_str_parts(field_ty: &syn::Type) -> (Vec<String>, Vec<syn::Type>) {
155155
types.push(ty.clone());
156156
loop {
157157
match ty {
158-
syn::Type::Path(ref type_path) if type_path.qself == None => {
158+
syn::Type::Path(ref type_path) if type_path.qself.is_none() => {
159159
if let Some(segment) = type_path.path.segments.last() {
160160
parts.push(segment.ident.to_string());
161161
match &segment.arguments {

plotly_kaleido/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const KALEIDO_BIN: &str = "kaleido.exe";
3636
const KALEIDO_BIN: &str = "kaleido";
3737

3838
fn extract_zip(p: &Path, zip_file: &Path) -> Result<()> {
39-
let file = fs::File::open(&zip_file).unwrap();
39+
let file = fs::File::open(zip_file).unwrap();
4040
let mut archive = zip::ZipArchive::new(file).unwrap();
4141

4242
for i in 0..archive.len() {
@@ -68,7 +68,7 @@ fn extract_zip(p: &Path, zip_file: &Path) -> Result<()> {
6868
);
6969
if let Some(p) = outpath.parent() {
7070
if !p.exists() {
71-
fs::create_dir_all(&p).unwrap();
71+
fs::create_dir_all(p).unwrap();
7272
}
7373
}
7474
let mut outfile = fs::File::create(&outpath).unwrap();
@@ -104,13 +104,13 @@ fn main() -> Result<()> {
104104
let kaleido_zip_file = p.join("kaleido.zip");
105105

106106
let mut cmd = Command::new("cargo")
107-
.args(&["install", "ruget"])
107+
.args(["install", "ruget"])
108108
.spawn()
109109
.unwrap();
110110
cmd.wait()?;
111111

112112
let mut cmd = Command::new("ruget")
113-
.args(&[
113+
.args([
114114
KALEIDO_URL,
115115
"-o",
116116
kaleido_zip_file.as_path().to_str().unwrap(),

plotly_kaleido/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl Kaleido {
139139

140140
let process = Command::new(p.as_str())
141141
.current_dir(self.cmd_path.parent().unwrap())
142-
.args(&[
142+
.args([
143143
"plotly",
144144
"--disable-gpu",
145145
"--allow-file-access-from-files",

0 commit comments

Comments
 (0)