From ad1ae6079cf2ab7b384262f3a77100cfbf4fb5aa Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 19 Jun 2024 07:37:57 +0000 Subject: refactor(Node): rename content() to to_gemtext() This commit adds a `tests/node.rs` file to test `Node::to_gemtext`. --- src/ast/node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ast/node.rs b/src/ast/node.rs index 1040d2b..95190d2 100644 --- a/src/ast/node.rs +++ b/src/ast/node.rs @@ -173,9 +173,9 @@ pub enum Node { } impl Node { - /// Obtain the Gemtext content of a single [`Node`] as a [`String`] + /// Convert a single [`Node`] of any node type to a Gemtext [`String`] #[must_use] - pub fn content(&self) -> String { + pub fn to_gemtext(&self) -> String { super::Ast::from_nodes(vec![self.to_owned()]).to_gemtext() } } -- cgit v1.2.3