From 0c5d33f7d9820cd6ae4842970edfd5735ae6ad4e Mon Sep 17 00:00:00 2001 From: Gabe Jackson <17556281+gj@users.noreply.github.com> Date: Thu, 2 Dec 2021 11:44:03 -0500 Subject: [PATCH] Clippy for 1.57 (#1428) --- docs/examples/gitclub | 2 +- docs/examples/quickstart/go | 2 +- docs/examples/quickstart/java | 2 +- docs/examples/quickstart/nodejs | 2 +- docs/examples/quickstart/python | 2 +- docs/examples/quickstart/ruby | 2 +- docs/examples/quickstart/rust | 2 +- languages/rust/oso/src/host/class.rs | 6 ------ languages/rust/oso/tests/test_polar_rust.rs | 13 +++---------- 9 files changed, 10 insertions(+), 23 deletions(-) diff --git a/docs/examples/gitclub b/docs/examples/gitclub index a7ba77bdb8..63969fdbd0 160000 --- a/docs/examples/gitclub +++ b/docs/examples/gitclub @@ -1 +1 @@ -Subproject commit a7ba77bdb81cb0e61989b698961646be60b8c945 +Subproject commit 63969fdbd0d627cf63aaed0d2ab7f82978d91c84 diff --git a/docs/examples/quickstart/go b/docs/examples/quickstart/go index 64b32f66e2..a47c8f1ed9 160000 --- a/docs/examples/quickstart/go +++ b/docs/examples/quickstart/go @@ -1 +1 @@ -Subproject commit 64b32f66e201d7a2b9aae711c5ec0e047d44bcc8 +Subproject commit a47c8f1ed9dba0a91138f137cf4a7d0ba95ebd17 diff --git a/docs/examples/quickstart/java b/docs/examples/quickstart/java index 5db9baed45..63fbd8375f 160000 --- a/docs/examples/quickstart/java +++ b/docs/examples/quickstart/java @@ -1 +1 @@ -Subproject commit 5db9baed45121d2dc265de4220ff8950c6c1ce6a +Subproject commit 63fbd8375f591fb386b2c879f4b23799a3468766 diff --git a/docs/examples/quickstart/nodejs b/docs/examples/quickstart/nodejs index b02608dc6c..13b68022ec 160000 --- a/docs/examples/quickstart/nodejs +++ b/docs/examples/quickstart/nodejs @@ -1 +1 @@ -Subproject commit b02608dc6c99f189f2b736c70cc56fc0d7dc2654 +Subproject commit 13b68022ec1001be7fbaa20442e3ea7f455535b2 diff --git a/docs/examples/quickstart/python b/docs/examples/quickstart/python index 5621089a07..aaa6afbc96 160000 --- a/docs/examples/quickstart/python +++ b/docs/examples/quickstart/python @@ -1 +1 @@ -Subproject commit 5621089a07267b692ffd9c2998d3fa3ec72705af +Subproject commit aaa6afbc963f2cd8aabd688c09b906b518961c2d diff --git a/docs/examples/quickstart/ruby b/docs/examples/quickstart/ruby index bd23a3233e..aa92544b7a 160000 --- a/docs/examples/quickstart/ruby +++ b/docs/examples/quickstart/ruby @@ -1 +1 @@ -Subproject commit bd23a3233ed4b9f0d5218210fc60437037a8cdbc +Subproject commit aa92544b7ae762f5d45ce6b6eab0bd7801c240ad diff --git a/docs/examples/quickstart/rust b/docs/examples/quickstart/rust index 2a29975082..5eb28d274e 160000 --- a/docs/examples/quickstart/rust +++ b/docs/examples/quickstart/rust @@ -1 +1 @@ -Subproject commit 2a299750822a6afbea284671ef1bf5818cda69cb +Subproject commit 5eb28d274e8171a1489fec6cbaaf05a40f8db231 diff --git a/languages/rust/oso/src/host/class.rs b/languages/rust/oso/src/host/class.rs index b0aa3459d3..94c2b7862d 100644 --- a/languages/rust/oso/src/host/class.rs +++ b/languages/rust/oso/src/host/class.rs @@ -59,11 +59,6 @@ pub struct Class { /// Class methods on `T` class_methods: ClassMethods, - /// A method to check whether the supplied `TypeId` matches this class - /// (This isn't using `type_id` because we might want to register other types here - /// in order to check inheritance) - class_check: Arc bool + Send + Sync>, - /// A function that accepts arguments of this class and compares them for equality. /// Limitation: Only works on comparisons of the same type. equality_check: Arc crate::Result + Send + Sync>, @@ -148,7 +143,6 @@ where attributes: HashMap::new(), instance_methods: InstanceMethods::new(), class_methods: ClassMethods::new(), - class_check: Arc::new(|type_id| TypeId::of::() == type_id), equality_check: Arc::from(equality_not_supported()), into_iter: Arc::from(iterator_not_supported()), type_id: TypeId::of::(), diff --git a/languages/rust/oso/tests/test_polar_rust.rs b/languages/rust/oso/tests/test_polar_rust.rs index ddafe8a5fa..08e36fbd43 100644 --- a/languages/rust/oso/tests/test_polar_rust.rs +++ b/languages/rust/oso/tests/test_polar_rust.rs @@ -389,7 +389,7 @@ fn test_enums() { test.load_str( r#" - is_admin(Role::Admin); + is_admin(Role::Admin); is_member(Role::Member);"#, ); @@ -414,7 +414,6 @@ fn test_enums_and_structs() { #[derive(Clone, Debug, PolarClass)] struct User { - name: String, #[polar(attribute)] role: Role, } @@ -435,15 +434,9 @@ fn test_enums_and_structs() { ) .unwrap(); - let admin = User { - name: "sudo".to_string(), - role: Role::Admin, - }; + let admin = User { role: Role::Admin }; - let member = User { - name: "not sudo".to_string(), - role: Role::Member, - }; + let member = User { role: Role::Member }; assert!(test.oso.is_allowed(admin, "read", "resource").unwrap()); assert!(!test.oso.is_allowed(member, "read", "resource").unwrap());