Skip to content

Commit ff85a81

Browse files
committed
rename structs and remove simpler demos as not useful
1 parent 1f93a39 commit ff85a81

File tree

3 files changed

+14
-29
lines changed

3 files changed

+14
-29
lines changed

demo/src/apps/custom_input.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ use serde_json::{Value, json};
44

55
use super::Show;
66

7-
pub struct CustomExample {
7+
pub struct CustomInputExample {
88
input: String,
99
}
1010

11-
impl CustomExample {
11+
impl CustomInputExample {
1212
pub fn new() -> Self {
1313
Self {
1414
input: serde_json::to_string_pretty(&json!({"foo": "bar"})).unwrap(),
1515
}
1616
}
1717
}
1818

19-
impl Show for CustomExample {
19+
impl Show for CustomInputExample {
2020
fn title(&self) -> &'static str {
2121
"Custom Input"
2222
}

demo/src/apps/toggle_buttons.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use serde_json::Value;
44

55
use super::Show;
66

7-
pub struct ToggleButtonsCustomisationDemo {
7+
pub struct ToggleButtonsExample {
88
value: Value,
99
toggle_buttons_state: ToggleButtonsState,
1010
}
1111

12-
impl ToggleButtonsCustomisationDemo {
12+
impl ToggleButtonsExample {
1313
pub fn new(value: Value) -> Self {
1414
Self {
1515
value,
@@ -18,7 +18,7 @@ impl ToggleButtonsCustomisationDemo {
1818
}
1919
}
2020

21-
impl Show for ToggleButtonsCustomisationDemo {
21+
impl Show for ToggleButtonsExample {
2222
fn title(&self) -> &'static str {
2323
"Toggle Buttons Customisation"
2424
}

demo/src/main.rs

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use apps::{
2-
Example, Show, copy_to_clipboard::CopyToClipboardExample, custom_input::CustomExample,
3-
editor::JsonEditorExample, search::SearchExample,
4-
toggle_buttons::ToggleButtonsCustomisationDemo, wrapping::WrappingExample,
2+
Show, copy_to_clipboard::CopyToClipboardExample, custom_input::CustomInputExample,
3+
editor::JsonEditorExample, search::SearchExample, toggle_buttons::ToggleButtonsExample,
4+
wrapping::WrappingExample,
55
};
66
use serde_json::json;
77

8-
use crate::apps::default_expand::DefaultExpandExample;
8+
use crate::apps::{Example, default_expand::DefaultExpandExample};
99

1010
mod apps;
1111

@@ -35,28 +35,13 @@ impl Default for DemoApp {
3535

3636
Self {
3737
examples: vec![
38-
Box::new(Example::new("Null", json!(null))),
39-
Box::new(Example::new("Bool", json!(true))),
40-
Box::new(Example::new("Number (int)", json!(42))),
41-
Box::new(Example::new("Number (neg int)", json!(-273))),
42-
Box::new(Example::new("Number (float)", json!(13.37))),
43-
Box::new(Example::new("String", json!("This is a string!"))),
44-
Box::new(Example::new("Array", json!([1, 2, 3]))),
45-
Box::new(Example::new(
46-
"Nested Arrays",
47-
json!([1, [2, 3, 4], [5, 6, [7], 8], [9, [[], 10]]]),
48-
)),
49-
Box::new(Example::new(
50-
"Object",
51-
json!({"foo": 123, "bar": "Hello world!", "baz": null}),
52-
)),
53-
Box::new(Example::new("Complex Object", complex_object.clone())),
54-
Box::new(CustomExample::new()),
38+
Box::new(Example::new("Object", complex_object.clone())),
39+
Box::new(DefaultExpandExample::new(complex_object.clone())),
5540
Box::new(SearchExample::new(complex_object.clone())),
41+
Box::new(CustomInputExample::new()),
5642
Box::new(CopyToClipboardExample::new(complex_object.clone())),
5743
Box::new(JsonEditorExample::new(complex_object.clone())),
58-
Box::new(DefaultExpandExample::new(complex_object.clone())),
59-
Box::new(ToggleButtonsCustomisationDemo::new(complex_object)),
44+
Box::new(ToggleButtonsExample::new(complex_object)),
6045
Box::new(WrappingExample::new(long_strings_object)),
6146
],
6247
open_example_idx: None,

0 commit comments

Comments
 (0)