Skip to content

Commit

Permalink
0.0.41
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy-Sheppard committed Oct 4, 2024
1 parent d621e43 commit 4311306
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chart-js-rs"
version = "0.0.40"
version = "0.0.41"
edition = "2021"
authors = ["Billy Sheppard", "Luis Moreno"]
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(clippy::ptr_arg, clippy::collapsible_if)]

use std::{fmt::Debug, io::Write, ops::Not};
use std::{io::Write, ops::Not};

use heck::ToSnakeCase;
use itertools::Itertools;
Expand Down Expand Up @@ -285,7 +285,7 @@ fn ident(i: &str) -> Result<syn::Type, syn::Error> {
syn::parse_str(i)
}

// fn append_log(s: impl Debug) {
// fn append_log(s: impl std::fmt::Debug) {
// let mut file = std::fs::OpenOptions::new()
// .append(true)
// .open("build_logs.txt")
Expand Down
10 changes: 5 additions & 5 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,20 @@ impl Chart {
rationalise_2_levels::<1>(&dataset, ("datalabels", "formatter"));
rationalise_2_levels::<1>(&dataset, ("datalabels", "offset"));
});

// Handle options.scales
if let Some(scales) = object_values_at(&self.obj, "options.scales") {
Object::values(&scales.dyn_into().unwrap())
.iter()
.for_each(|scale| {
rationalise_2_levels::<3>(&scale, ("ticks", "callback"));
});
}

}
// Handle options.plugins.legend
if let Some(legend) = object_values_at(&self.obj, "options.plugins.legend") {
rationalise_2_levels::<2>(&legend, ("labels", "filter"));
}

// Handle options.plugins.tooltip
if let Some(legend) = object_values_at(&self.obj, "options.plugins.tooltip") {
rationalise_1_level::<1>(&legend, "filter");
Expand Down Expand Up @@ -248,7 +247,8 @@ impl<const N: usize> Serialize for FnWithArgs<N> {

impl<const N: usize> FnWithArgs<N> {
pub fn is_empty(&self) -> bool {
self.args.is_empty() && self.body.is_empty()
self.args.iter().any(|arg| arg.is_empty()) || (
self.args.is_empty() && self.body.is_empty())
}

pub fn new() -> Self {
Expand Down

0 comments on commit 4311306

Please sign in to comment.