From c9d0fa4a5ad04bd5422ed0e1c4fcc498f4700b07 Mon Sep 17 00:00:00 2001 From: Harry Barber Date: Fri, 25 Nov 2022 12:43:08 +0000 Subject: [PATCH] Use Op::NAME --- rust-runtime/aws-smithy-http-server/src/plugin/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust-runtime/aws-smithy-http-server/src/plugin/mod.rs b/rust-runtime/aws-smithy-http-server/src/plugin/mod.rs index fa1c3c8e6f2..093baa3afd1 100644 --- a/rust-runtime/aws-smithy-http-server/src/plugin/mod.rs +++ b/rust-runtime/aws-smithy-http-server/src/plugin/mod.rs @@ -13,11 +13,13 @@ //! ``` //! # use aws_smithy_http_server::plugin::*; //! # let layer = (); +//! # struct GetPokemonSpecies; +//! # impl GetPokemonSpecies { const NAME: &'str = "" }; //! // Create a `Plugin` from a HTTP `Layer` //! let plugin = HttpLayer(layer); //! //! // Only apply the layer to operations with name "GetPokemonSpecies" -//! let plugin = filter_by_operation_name(plugin, |name| name == "GetPokemonSpecies"); +//! let plugin = filter_by_operation_name(plugin, |name| name == GetPokemonSpecies::NAME); //! ``` //! //! # Construct a [`Plugin`] from a closure that takes as input the operation name