Skip to content

Commit

Permalink
Resolved the clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kitao committed Jan 8, 2022
1 parent 517cde8 commit 795d1d8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.5.8
- Fixed a pyxapp to be included in Python wheel
- Resolved the clippy warnings

## 1.5.7
- Fixed the example #11 images
Expand Down
6 changes: 3 additions & 3 deletions lib/wrapper/src/graphics_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn tilemap(tm: u32) -> Tilemap {
fn clip(x: Option<f64>, y: Option<f64>, w: Option<f64>, h: Option<f64>) -> PyResult<()> {
if let (Some(x), Some(y), Some(w), Some(h)) = (x, y, w, h) {
instance().clip(x, y, w, h);
} else if let (None, None, None, None) = (x, y, w, h) {
} else if (x, y, w, h) == (None, None, None, None) {
instance().clip0();
} else {
type_error!("clip() takes 0 or 4 arguments");
Expand All @@ -31,7 +31,7 @@ fn clip(x: Option<f64>, y: Option<f64>, w: Option<f64>, h: Option<f64>) -> PyRes
fn camera(x: Option<f64>, y: Option<f64>) -> PyResult<()> {
if let (Some(x), Some(y)) = (x, y) {
instance().camera(x, y);
} else if let (None, None) = (x, y) {
} else if (x, y) == (None, None) {
instance().camera0();
} else {
type_error!("camera() takes 0 or 2 arguments");
Expand All @@ -43,7 +43,7 @@ fn camera(x: Option<f64>, y: Option<f64>) -> PyResult<()> {
fn pal(col1: Option<Color>, col2: Option<Color>) -> PyResult<()> {
if let (Some(col1), Some(col2)) = (col1, col2) {
instance().pal(col1, col2);
} else if let (None, None) = (col1, col2) {
} else if (col1, col2) == (None, None) {
instance().pal0();
} else {
type_error!("pal() takes 0 or 2 arguments");
Expand Down
4 changes: 2 additions & 2 deletions lib/wrapper/src/image_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl Image {
) -> PyResult<()> {
if let (Some(x), Some(y), Some(w), Some(h)) = (x, y, w, h) {
self.pyxel_image.lock().clip(x, y, w, h);
} else if let (None, None, None, None) = (x, y, w, h) {
} else if (x, y, w, h) == (None, None, None, None) {
self.pyxel_image.lock().clip0();
} else {
type_error!("clip() takes 0 or 4 arguments");
Expand All @@ -79,7 +79,7 @@ impl Image {
pub fn camera(&self, x: Option<f64>, y: Option<f64>) -> PyResult<()> {
if let (Some(x), Some(y)) = (x, y) {
self.pyxel_image.lock().camera(x, y);
} else if let (None, None) = (x, y) {
} else if (x, y) == (None, None) {
self.pyxel_image.lock().camera0();
} else {
type_error!("camera() takes 0 or 2 arguments");
Expand Down
1 change: 1 addition & 0 deletions lib/wrapper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
clippy::missing_panics_doc,
clippy::multiple_crate_versions,
clippy::must_use_candidate,
clippy::needless_option_as_deref,
clippy::needless_pass_by_value,
clippy::new_without_default,
clippy::pedantic,
Expand Down

0 comments on commit 795d1d8

Please # to comment.