From 6792b9095e0cb9a0085b28ef1db7738e8993f7b5 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 09:45:09 -0700 Subject: [PATCH 01/22] Add Azure Pipelines configuration from https://github.com/crate-ci/azure-pipelines --- azure-pipelines.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..b9059522 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,10 @@ +jobs: + - template: default.yml@templates + +resources: + repositories: + - repository: templates + type: github + name: crate-ci/azure-pipelines + ref: refs/heads/v0.4 + endpoint: ice_ix From 40fcbfbcd2c898e5d75b5412f164221bc77cb07d Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 09:52:20 -0700 Subject: [PATCH 02/22] Fix endpoint name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b9059522..c0a50e84 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,4 +7,4 @@ resources: type: github name: crate-ci/azure-pipelines ref: refs/heads/v0.4 - endpoint: ice_ix + endpoint: iceiix From 58631893975d3cd64457c537ced1779402359c83 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 09:56:55 -0700 Subject: [PATCH 03/22] Minimum supported Rust version is 1.44.1 Not crate-ci's default of 1.32.0 https://github.com/crate-ci/azure-pipelines#minimum-supported-rust-version-msrv --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c0a50e84..c3612d20 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,7 @@ jobs: - template: default.yml@templates + parameters: + minrust: 1.44.1 resources: repositories: From 1b9145e760e3cfb344f5e5d173e55a33ff29536b Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 10:38:36 -0700 Subject: [PATCH 04/22] blocks: fix missing panic parameter (found by clippy panic_params) --- blocks/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/src/lib.rs b/blocks/src/lib.rs index b5bcda84..9b991174 100644 --- a/blocks/src/lib.rs +++ b/blocks/src/lib.rs @@ -7264,7 +7264,7 @@ impl TreeVariant { TreeVariant::Spruce | TreeVariant::DarkOak => 1, TreeVariant::Birch => 2, TreeVariant::Jungle => 3, - _ => panic!("TreeVariant {:?} has no data (1.13+ only)"), + _ => panic!("TreeVariant {:?} has no data (1.13+ only)", self), } } From 389df39b0c9cccd66b28b4b666b0133e44243a0c Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 11:08:46 -0700 Subject: [PATCH 05/22] Attempt to disable clippy warnings in generated code, but cannot use top-level annotations here --- gl/build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gl/build.rs b/gl/build.rs index 2ede0324..40e9fa30 100644 --- a/gl/build.rs +++ b/gl/build.rs @@ -2,6 +2,7 @@ use gl_generator::{Api, Fallbacks, GlobalGenerator, Profile, Registry}; use std::env; use std::fs::File; use std::io::BufWriter; +use std::io::Write; use std::path::Path; fn main() { @@ -9,6 +10,8 @@ fn main() { let dest = Path::new(&out_dir); let mut file = BufWriter::new(File::create(&dest.join("bindings.rs")).unwrap()); + file.write_all(b"#![allow(clippy::all)]\n").unwrap(); + Registry::new(Api::Gl, (3, 2), Profile::Core, Fallbacks::All, []) .write_bindings(GlobalGenerator, &mut file) .unwrap(); From f857f89d976b2488e93f2be92fc41064f54d5037 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 11:08:52 -0700 Subject: [PATCH 06/22] Revert "Attempt to disable clippy warnings in generated code, but cannot use top-level annotations here" This reverts commit 389df39b0c9cccd66b28b4b666b0133e44243a0c. --- gl/build.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/gl/build.rs b/gl/build.rs index 40e9fa30..2ede0324 100644 --- a/gl/build.rs +++ b/gl/build.rs @@ -2,7 +2,6 @@ use gl_generator::{Api, Fallbacks, GlobalGenerator, Profile, Registry}; use std::env; use std::fs::File; use std::io::BufWriter; -use std::io::Write; use std::path::Path; fn main() { @@ -10,8 +9,6 @@ fn main() { let dest = Path::new(&out_dir); let mut file = BufWriter::new(File::create(&dest.join("bindings.rs")).unwrap()); - file.write_all(b"#![allow(clippy::all)]\n").unwrap(); - Registry::new(Api::Gl, (3, 2), Profile::Core, Fallbacks::All, []) .write_bindings(GlobalGenerator, &mut file) .unwrap(); From 42055427b5e0757a17c59b7b455d8e9f71400141 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 11:09:15 -0700 Subject: [PATCH 07/22] Attempt to disable clippy in azure-pipelines --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c3612d20..1798bf49 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,11 +2,12 @@ jobs: - template: default.yml@templates parameters: minrust: 1.44.1 + clippy: false resources: repositories: - repository: templates type: github - name: crate-ci/azure-pipelines - ref: refs/heads/v0.4 + name: iceiix/azure-pipelines + ref: refs/heads/clippy endpoint: iceiix From 384dfe96e27848fc8be5bded2afa3d4b8074b892 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 11:13:58 -0700 Subject: [PATCH 08/22] Empty commit From a4bc8dbfebdb6c4056dbc5b8ef782346ee2f9697 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 11:15:12 -0700 Subject: [PATCH 09/22] Use exact commit --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1798bf49..7df6ac2b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,5 +9,5 @@ resources: - repository: templates type: github name: iceiix/azure-pipelines - ref: refs/heads/clippy + ref: 45be62021ece7ac2776aba48ba88d539bb6b6bf8 endpoint: iceiix From 9c5659e92c8cd6d243b0dc67b2cd3c6c09989f9b Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 11:17:42 -0700 Subject: [PATCH 10/22] Pass clippy parameters --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7df6ac2b..adc67dd4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,12 +2,12 @@ jobs: - template: default.yml@templates parameters: minrust: 1.44.1 - clippy: false + clippy: -A all resources: repositories: - repository: templates type: github name: iceiix/azure-pipelines - ref: 45be62021ece7ac2776aba48ba88d539bb6b6bf8 + ref: 11424963ee96daf8cb5cd6b546cb79f168be298b endpoint: iceiix From 1f765ebb71e2e0303ad6b8a5cc06c7895112c5ae Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 11:33:54 -0700 Subject: [PATCH 11/22] Fix to_string shadowing fmt::Display fmt https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string_shadow_display --- protocol/src/format.rs | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/protocol/src/format.rs b/protocol/src/format.rs index aed20803..55cd4e28 100644 --- a/protocol/src/format.rs +++ b/protocol/src/format.rs @@ -187,7 +187,29 @@ pub enum Color { impl fmt::Display for Color { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.to_string()) + write!( + f, + "{}", + match *self { + Color::Black => "black".to_owned(), + Color::DarkBlue => "dark_blue".to_owned(), + Color::DarkGreen => "dark_green".to_owned(), + Color::DarkAqua => "dark_aqua".to_owned(), + Color::DarkRed => "dark_red".to_owned(), + Color::DarkPurple => "dark_purple".to_owned(), + Color::Gold => "gold".to_owned(), + Color::Gray => "gray".to_owned(), + Color::DarkGray => "dark_gray".to_owned(), + Color::Blue => "blue".to_owned(), + Color::Green => "green".to_owned(), + Color::Aqua => "aqua".to_owned(), + Color::Red => "red".to_owned(), + Color::LightPurple => "light_purple".to_owned(), + Color::Yellow => "yellow".to_owned(), + Color::White => "white".to_owned(), + Color::RGB(r, g, b) => format!("#{:02X}{:02X}{:02X}", r, g, b), + } + ) } } @@ -228,28 +250,6 @@ impl Color { } } - pub fn to_string(&self) -> String { - match *self { - Color::Black => "black".to_owned(), - Color::DarkBlue => "dark_blue".to_owned(), - Color::DarkGreen => "dark_green".to_owned(), - Color::DarkAqua => "dark_aqua".to_owned(), - Color::DarkRed => "dark_red".to_owned(), - Color::DarkPurple => "dark_purple".to_owned(), - Color::Gold => "gold".to_owned(), - Color::Gray => "gray".to_owned(), - Color::DarkGray => "dark_gray".to_owned(), - Color::Blue => "blue".to_owned(), - Color::Green => "green".to_owned(), - Color::Aqua => "aqua".to_owned(), - Color::Red => "red".to_owned(), - Color::LightPurple => "light_purple".to_owned(), - Color::Yellow => "yellow".to_owned(), - Color::White => "white".to_owned(), - Color::RGB(r, g, b) => format!("#{:02X}{:02X}{:02X}", r, g, b), - } - } - pub fn to_rgb(&self) -> (u8, u8, u8) { match *self { Color::Black => (0, 0, 0), From ded704fd396e73f0f89b4b107505b719a8f1f308 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 12:03:12 -0700 Subject: [PATCH 12/22] Fix warning: lint name is deprecated and does not have an effect anymore. Use: clippy::all --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index adc67dd4..0c027d62 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,7 @@ jobs: - template: default.yml@templates parameters: minrust: 1.44.1 - clippy: -A all + clippy: -A clippy::all resources: repositories: From 170d0b9ef6e00a771fd6b8eae3a2e88fe799d567 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 12:16:46 -0700 Subject: [PATCH 13/22] Allow erroring clippy float_cmp and unsafe ptrs --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0c027d62..d281dd4d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,7 @@ jobs: - template: default.yml@templates parameters: minrust: 1.44.1 - clippy: -A clippy::all + clippy: -A clippy::all -A clippy::temporary_cstring_as_ptr -A clippy::not_unsafe_ptr_arg_deref -A clippy::float_cmp resources: repositories: From b65c2907c2812810742a597f2a2a9400f0465e29 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 12:51:14 -0700 Subject: [PATCH 14/22] Update azure-pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d281dd4d..3a36741f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,5 +9,5 @@ resources: - repository: templates type: github name: iceiix/azure-pipelines - ref: 11424963ee96daf8cb5cd6b546cb79f168be298b + ref: 402313a6fc7cbe76a8ac2a7efebd279bf3cc5a2c endpoint: iceiix From b8a4e8796af3152beffb45ca3b5780ba267b1b36 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 13:05:05 -0700 Subject: [PATCH 15/22] Relax allowed clippy warnings --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3a36741f..a6b0dd24 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,7 @@ jobs: - template: default.yml@templates parameters: minrust: 1.44.1 - clippy: -A clippy::all -A clippy::temporary_cstring_as_ptr -A clippy::not_unsafe_ptr_arg_deref -A clippy::float_cmp + clippy: -A clippy::temporary_cstring_as_ptr -A clippy::not_unsafe_ptr_arg_deref -A clippy::float_cmp resources: repositories: From 90a1659b1852ec8667800a8db4530bc59788ec02 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 13:17:49 -0700 Subject: [PATCH 16/22] Install xcb libraries for -lxcb-shape, -lxcb-xfixes --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a6b0dd24..be441770 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,8 @@ jobs: - template: default.yml@templates parameters: + setup: + - script: apt-get install libxcb-composite0-dev libx11-dev minrust: 1.44.1 clippy: -A clippy::temporary_cstring_as_ptr -A clippy::not_unsafe_ptr_arg_deref -A clippy::float_cmp From 34fa19e775b7a5eb16c749c13ad88fdac3027b82 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 13:19:19 -0700 Subject: [PATCH 17/22] sudo --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index be441770..5ac4371a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,7 @@ jobs: - template: default.yml@templates parameters: setup: - - script: apt-get install libxcb-composite0-dev libx11-dev + - script: sudo apt-get install libxcb-composite0-dev libx11-dev minrust: 1.44.1 clippy: -A clippy::temporary_cstring_as_ptr -A clippy::not_unsafe_ptr_arg_deref -A clippy::float_cmp From d885b8c8efda852ec718dcab215f1a05be4dde21 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 13:31:10 -0700 Subject: [PATCH 18/22] Only run apt-get on Linux --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5ac4371a..48a599c5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,6 +3,8 @@ jobs: parameters: setup: - script: sudo apt-get install libxcb-composite0-dev libx11-dev + displayName: "Install libxcb" + condition: eq(variables['Agent.OS'], 'Linux') minrust: 1.44.1 clippy: -A clippy::temporary_cstring_as_ptr -A clippy::not_unsafe_ptr_arg_deref -A clippy::float_cmp From 7b178955ea6d445246f5d58a9ca635678f681582 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 13:34:34 -0700 Subject: [PATCH 19/22] Update build dependencies task name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 48a599c5..8ea324aa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,7 +3,7 @@ jobs: parameters: setup: - script: sudo apt-get install libxcb-composite0-dev libx11-dev - displayName: "Install libxcb" + displayName: "Install build dependencies" condition: eq(variables['Agent.OS'], 'Linux') minrust: 1.44.1 clippy: -A clippy::temporary_cstring_as_ptr -A clippy::not_unsafe_ptr_arg_deref -A clippy::float_cmp From 0ac3a3eef66c6df4517eea2080c80377ff358836 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 13:54:08 -0700 Subject: [PATCH 20/22] Squash merge --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8ea324aa..73e954d6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,5 +13,5 @@ resources: - repository: templates type: github name: iceiix/azure-pipelines - ref: 402313a6fc7cbe76a8ac2a7efebd279bf3cc5a2c + ref: c50d2b8335a6b1856aa2fc4f5f41f6684ef8580c endpoint: iceiix From a4068bcb0a993b6f302208cd0e80242cfbb75307 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 14:01:30 -0700 Subject: [PATCH 21/22] Revert "blocks: fix missing panic parameter (found by clippy panic_params)" This reverts commit 1b9145e760e3cfb344f5e5d173e55a33ff29536b. --- blocks/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/src/lib.rs b/blocks/src/lib.rs index 9b991174..b5bcda84 100644 --- a/blocks/src/lib.rs +++ b/blocks/src/lib.rs @@ -7264,7 +7264,7 @@ impl TreeVariant { TreeVariant::Spruce | TreeVariant::DarkOak => 1, TreeVariant::Birch => 2, TreeVariant::Jungle => 3, - _ => panic!("TreeVariant {:?} has no data (1.13+ only)", self), + _ => panic!("TreeVariant {:?} has no data (1.13+ only)"), } } From 724be5e1888078368cfac7da0c69e66749bddbd9 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 28 Jun 2020 14:04:18 -0700 Subject: [PATCH 22/22] Revert "Fix to_string shadowing fmt::Display fmt" This reverts commit 1f765ebb71e2e0303ad6b8a5cc06c7895112c5ae. --- protocol/src/format.rs | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/protocol/src/format.rs b/protocol/src/format.rs index 55cd4e28..aed20803 100644 --- a/protocol/src/format.rs +++ b/protocol/src/format.rs @@ -187,29 +187,7 @@ pub enum Color { impl fmt::Display for Color { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!( - f, - "{}", - match *self { - Color::Black => "black".to_owned(), - Color::DarkBlue => "dark_blue".to_owned(), - Color::DarkGreen => "dark_green".to_owned(), - Color::DarkAqua => "dark_aqua".to_owned(), - Color::DarkRed => "dark_red".to_owned(), - Color::DarkPurple => "dark_purple".to_owned(), - Color::Gold => "gold".to_owned(), - Color::Gray => "gray".to_owned(), - Color::DarkGray => "dark_gray".to_owned(), - Color::Blue => "blue".to_owned(), - Color::Green => "green".to_owned(), - Color::Aqua => "aqua".to_owned(), - Color::Red => "red".to_owned(), - Color::LightPurple => "light_purple".to_owned(), - Color::Yellow => "yellow".to_owned(), - Color::White => "white".to_owned(), - Color::RGB(r, g, b) => format!("#{:02X}{:02X}{:02X}", r, g, b), - } - ) + write!(f, "{}", self.to_string()) } } @@ -250,6 +228,28 @@ impl Color { } } + pub fn to_string(&self) -> String { + match *self { + Color::Black => "black".to_owned(), + Color::DarkBlue => "dark_blue".to_owned(), + Color::DarkGreen => "dark_green".to_owned(), + Color::DarkAqua => "dark_aqua".to_owned(), + Color::DarkRed => "dark_red".to_owned(), + Color::DarkPurple => "dark_purple".to_owned(), + Color::Gold => "gold".to_owned(), + Color::Gray => "gray".to_owned(), + Color::DarkGray => "dark_gray".to_owned(), + Color::Blue => "blue".to_owned(), + Color::Green => "green".to_owned(), + Color::Aqua => "aqua".to_owned(), + Color::Red => "red".to_owned(), + Color::LightPurple => "light_purple".to_owned(), + Color::Yellow => "yellow".to_owned(), + Color::White => "white".to_owned(), + Color::RGB(r, g, b) => format!("#{:02X}{:02X}{:02X}", r, g, b), + } + } + pub fn to_rgb(&self) -> (u8, u8, u8) { match *self { Color::Black => (0, 0, 0),