-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
58 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use crate::generic_node::GenericNode; | ||
|
||
/// Result of the [`template`] macro. | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub struct TemplateResult<G: GenericNode> { | ||
node: G, | ||
} | ||
|
||
impl<G: GenericNode> TemplateResult<G> { | ||
/// Create a new [`TemplateResult`] from a [`GenericNode`]. | ||
pub fn new(node: G) -> Self { | ||
Self { node } | ||
} | ||
|
||
/// Create a new [`TemplateResult`] with a blank comment node | ||
pub fn empty() -> Self { | ||
Self::new(G::marker()) | ||
} | ||
|
||
pub fn inner_node(&self) -> &G { | ||
&self.node | ||
} | ||
} |