Skip to content

Commit

Permalink
Plugin API Parser: Small fixes for export macro
Browse files Browse the repository at this point in the history
- Fixes inside the macro
- Adding missing use statements for the doc example
  • Loading branch information
AmmarAbouZor committed Jul 18, 2024
1 parent 44ba3a6 commit a593d0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions application/apps/indexer/plugins_api/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ pub trait Parser {
/// # Examples
///
/// ```
/// # use crate::parser::*;
/// # use plugins_api::parser::*;
/// # use plugins_api::*;
/// # use std::path::PathBuf;
///
/// struct CustomParser;
///
Expand Down Expand Up @@ -95,7 +97,9 @@ macro_rules! parser_export {
// Define logger as static field to use it with macro initialization
use $crate::__PluginLogger;
use $crate::parser::__ParserLogSend;
static LOGGER: __PluginLogger<__ParserLogSend> = __PluginLogger::new(__ParserLogSend);
static LOGGER: __PluginLogger<__ParserLogSend> = __PluginLogger {
sender: __ParserLogSend,
};

// Name intentionally lengthened to avoid conflict with user's own types
struct InternalPluginParserGuest;
Expand Down
2 changes: 1 addition & 1 deletion application/apps/indexer/plugins_api/src/plugin_logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct PluginLogger<C>
where
C: LogSend,
{
sender: C,
pub sender: C,
}

impl<C> Log for PluginLogger<C>
Expand Down

0 comments on commit a593d0e

Please sign in to comment.