Skip to content

Commit ceb5c6d

Browse files
committed
Adjust changelog and tests
1 parent 31e2c6b commit ceb5c6d

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
1414
- [[#161](https://github.com/plotly/plotly.rs/pull/161)] Added `Axis` `scaleanchor` settter.
1515
- [[#159](https://github.com/plotly/plotly.rs/pull/159)] Make `heat_map` module public to expose `Smoothing enum`.
1616
- [[#153](https://github.com/plotly/plotly.rs/pull/153)] Added `LayoutScene`.
17-
- [[#154](https://github.com/plotly/plotly.rs/pull/154)] Improve ergonomics of `Title` struct: `new` method now takes no arguments as per other structs, whilst a new `with_text()` constructor is added for convenience. Where other structs contain a `Title`, users can now call the `title()` method with anything that `impl`s `Into<Title>`, viz. `String`, `&String`, `&str` and `Title`.
17+
- [[#154](https://github.com/plotly/plotly.rs/pull/154)] Improve ergonomics of `Title` and `LegendGroupTitle` structs: `new` method now takes no arguments as per other structs, whilst a new `with_text()` constructor is added for convenience. Where other structs contain a `Title` (and `LegendGroupTitle`), users can now call the `title()` (and `legend_group_title()`) method with anything that `impl`s `Into<Title>`, viz. `String`, `&String`, `&str` and `Title`.
1818

1919
## [0.8.4] - 2023-07-09
2020
### Added

plotly/src/layout/update_menu.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,7 @@ mod tests {
246246
use serde_json::{json, to_value};
247247

248248
use super::*;
249-
use crate::{
250-
common::{Title, Visible},
251-
Layout,
252-
};
249+
use crate::{common::Visible, Layout};
253250

254251
#[test]
255252
fn test_serialize_button_method() {
@@ -315,7 +312,7 @@ mod tests {
315312
Visible::True,
316313
Visible::False,
317314
]))
318-
.push_relayout(Layout::modify_title(Title::with_text("Hello".to_string())))
315+
.push_relayout(Layout::modify_title("Hello"))
319316
.push_relayout(Layout::modify_width(20))
320317
.build();
321318

plotly/src/plot.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ impl Plot {
463463
fn show_with_default_app(temp_path: &str) {
464464
use std::process::Command;
465465
Command::new("open")
466-
.args(&[temp_path])
466+
.args([temp_path])
467467
.output()
468468
.expect(DEFAULT_HTML_APP_NOT_FOUND);
469469
}
@@ -597,9 +597,7 @@ mod tests {
597597
#[test]
598598
fn test_layout_to_json() {
599599
let mut plot = create_test_plot();
600-
let layout = Layout::new()
601-
.title("TestTitle")
602-
.title(crate::common::Title::with_text("TestTitle"));
600+
let layout = Layout::new().title("TestTitle");
603601
plot.set_layout(layout);
604602

605603
let expected = json!({

plotly/src/traces/heat_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ mod tests {
206206
.hover_template_array(vec!["tmpl1", "tmpl2"])
207207
.hover_text(vec!["hov", "er"])
208208
.legend_group("1")
209-
.legend_group_title(LegendGroupTitle::new("Legend Group Title"))
209+
.legend_group_title("Legend Group Title")
210210
.name("name")
211211
.opacity(0.99)
212212
.reverse_scale(false)

0 commit comments

Comments
 (0)