Skip to content

Commit 41c0119

Browse files
fix(docs): format serde plugin config and remove import
Signed-off-by: Anton Engelhardt <[email protected]>
1 parent 3c5b187 commit 41c0119

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/traits.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ pub trait RootContext: Context {
350350
/// ```rust
351351
/// use proxy_wasm::traits::*;
352352
/// use proxy_wasm::types::*;
353-
/// use serde_json;
354353
/// use log::debug;
355354
///
356355
/// struct MyRootContext;
@@ -365,7 +364,8 @@ pub trait RootContext: Context {
365364
/// fn on_vm_start(&mut self, _vm_configuration_size: usize) -> bool {
366365
/// let vm_configuration = self.get_vm_configuration().unwrap();
367366
///
368-
/// let parsed_vm_configuration: MyVmConfiguration = serde_json::from_slice::<MyVmConfiguration>(&vm_configuration).unwrap();
367+
/// let parsed_vm_configuration: MyVmConfiguration =
368+
/// serde_json::from_slice::<MyVmConfiguration>(&vm_configuration).unwrap();
369369
///
370370
/// // Do something with the parsed vm configuration
371371
/// debug!("vm_configuration: {:?}", parsed_vm_configuration)
@@ -389,7 +389,6 @@ pub trait RootContext: Context {
389389
/// ```rust
390390
/// use proxy_wasm::traits::*;
391391
/// use proxy_wasm::types::*;
392-
/// use serde_json;
393392
/// use log::debug;
394393
///
395394
/// struct MyRootContext;
@@ -404,7 +403,8 @@ pub trait RootContext: Context {
404403
/// fn on_vm_start(&mut self, _vm_configuration_size: usize) -> bool {
405404
/// let vm_configuration = self.get_vm_configuration().unwrap();
406405
///
407-
/// let parsed_vm_configuration: MyVmConfiguration = serde_json::from_slice::<MyVmConfiguration>(&vm_configuration).unwrap();
406+
/// let parsed_vm_configuration: MyVmConfiguration =
407+
/// serde_json::from_slice::<MyVmConfiguration>(&vm_configuration).unwrap();
408408
///
409409
/// // Do something with the parsed vm configuration
410410
/// debug!("vm_configuration: {:?}", parsed_vm_configuration)
@@ -433,7 +433,6 @@ pub trait RootContext: Context {
433433
/// ```rust
434434
/// use proxy_wasm::traits::*;
435435
/// use proxy_wasm::types::*;
436-
/// use serde_json;
437436
/// use log::debug;
438437
///
439438
/// struct MyRootContext;
@@ -448,7 +447,8 @@ pub trait RootContext: Context {
448447
/// fn on_configure(&mut self, _plugin_configuration_size: usize) -> bool {
449448
/// let plugin_configuration = self.get_plugin_configuration().unwrap();
450449
///
451-
/// let parsed_plugin_configuration: MyPluginConfiguration = serde_json::from_slice::<MyPluginConfiguration>(&plugin_configuration).unwrap();
450+
/// let parsed_plugin_configuration: MyPluginConfiguration =
451+
/// serde_json::from_slice::<MyPluginConfiguration>(&plugin_configuration).unwrap();
452452
///
453453
/// // Do something with the parsed plugin configuration
454454
/// debug!("plugin_configuration: {:?}", parsed_plugin_configuration)
@@ -472,7 +472,6 @@ pub trait RootContext: Context {
472472
/// ```rust
473473
/// use proxy_wasm::traits::*;
474474
/// use proxy_wasm::types::*;
475-
/// use serde_json;
476475
/// use log::debug;
477476
///
478477
/// struct MyRootContext;
@@ -487,7 +486,8 @@ pub trait RootContext: Context {
487486
/// fn on_configure(&mut self, _plugin_configuration_size: usize) -> bool {
488487
/// let plugin_configuration = self.get_plugin_configuration().unwrap();
489488
///
490-
/// let parsed_plugin_configuration: MyPluginConfiguration = serde_json::from_slice::<MyPluginConfiguration>(&plugin_configuration).unwrap();
489+
/// let parsed_plugin_configuration: MyPluginConfiguration =
490+
/// serde_json::from_slice::<MyPluginConfiguration>(&plugin_configuration).unwrap();
491491
///
492492
/// // Do something with the parsed plugin configuration
493493
/// debug!("plugin_configuration: {:?}", parsed_plugin_configuration)

0 commit comments

Comments
 (0)