diff --git a/.cargo/config.toml b/.cargo/config.toml index d784916..d7039fb 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,3 @@ [alias] -watch-check = ["watch", "-x", "check --examples --features ratatui-crossterm,search --no-default-features --tests", "-x", "check --examples --features search --tests"] -watch-test = ["watch", "-x", "test --features=search -- --skip=src/lib.rs", "-w", "src"] +watch-check = ["watch", "-x", "clippy --features ratatui-crossterm,search --no-default-features --examples --tests", "-x", "clippy --features search --examples --tests"] +watch-test = ["watch", "-x", "test --features=search -- --skip=src/lib.rs", "-w", "src", "-w", "tests"] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4a9cff1..47ce89c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,13 +29,15 @@ cargo test --features=search -- --skip src/lib.rs To run linters: ```sh -cargo clippy --all-features --examples +cargo clippy --features=search --tests --examples +cargo clippy --features=ratatui-crossterm,search --no-default-features --tests --examples cargo fmt -- --check ``` -If you use [cargo-watch][], `cargo watch-check` alias is useful to run checks automatically on writing to a file. +If you use [cargo-watch][], `cargo watch-check` and `cargo watch-test` aliases are useful to run checks/tests automatically +on writing to a file. -## Print debug +## Print debugging Since this crate uses stdout, `println!` is not available for debugging. Instead, stderr through [`eprintln!`][eprintln] or [`dbg!`][dbg] are useful. diff --git a/README.md b/README.md index 3294d4d..80d8bf1 100644 --- a/README.md +++ b/README.md @@ -673,7 +673,7 @@ This project is developed [on GitHub][repo]. For feature requests or bug reports, please [create an issue][new-issue]. For submitting patches, please [create a pull request][pulls]. -Please see [CONTRIBUTING.md](./CONTRIBUTING.md) before making a PR. +Please see [CONTRIBUTING.md](./CONTRIBUTING.md) before reporting an issue or making a PR. ## License diff --git a/src/cursor.rs b/src/cursor.rs index f4c0e99..f863c3c 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -332,14 +332,14 @@ mod tests { use crate::tui::widgets::Widget; use crate::{CursorMove, TextArea}; - let mut textarea: TextArea = (0..20).into_iter().map(|i| i.to_string()).collect(); + let mut textarea: TextArea = (0..20).map(|i| i.to_string()).collect(); let r = Rect { x: 0, y: 0, width: 24, height: 8, }; - let mut b = Buffer::empty(r.clone()); + let mut b = Buffer::empty(r); textarea.widget().render(r, &mut b); textarea.move_cursor(CursorMove::Bottom); diff --git a/src/scroll.rs b/src/scroll.rs index e9ff69f..7e97fc3 100644 --- a/src/scroll.rs +++ b/src/scroll.rs @@ -193,14 +193,14 @@ mod tests { use crate::tui::widgets::Widget; use crate::TextArea; - let mut textarea: TextArea = (0..20).into_iter().map(|i| i.to_string()).collect(); + let mut textarea: TextArea = (0..20).map(|i| i.to_string()).collect(); let r = Rect { x: 0, y: 0, width: 24, height: 8, }; - let mut b = Buffer::empty(r.clone()); + let mut b = Buffer::empty(r); textarea.widget().render(r, &mut b); textarea.scroll(Scrolling::Delta { rows: 2, cols: 0 }); diff --git a/src/textarea.rs b/src/textarea.rs index 61b11af..4415834 100644 --- a/src/textarea.rs +++ b/src/textarea.rs @@ -1690,14 +1690,14 @@ mod tests { use crate::tui::layout::Rect; use crate::tui::widgets::Widget; - let mut textarea: TextArea = (0..20).into_iter().map(|i| i.to_string()).collect(); + let mut textarea: TextArea = (0..20).map(|i| i.to_string()).collect(); let r = Rect { x: 0, y: 0, width: 24, height: 8, }; - let mut b = Buffer::empty(r.clone()); + let mut b = Buffer::empty(r); textarea.widget().render(r, &mut b); textarea.scroll((15, 0));