Skip to content

Commit

Permalink
Expose text chunk results
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtorikian committed Aug 4, 2024
1 parent bd57162 commit ad6cfd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions ext/selma/src/html/text_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl SelmaHTMLTextChunk {
}
}

fn before(&self, args: &[Value]) -> Result<(), Error> {
fn before(&self, args: &[Value]) -> Result<String, Error> {
let mut binding = self.0.borrow_mut();
let text_chunk = binding.text_chunk.get_mut().unwrap();

Expand All @@ -77,10 +77,10 @@ impl SelmaHTMLTextChunk {

text_chunk.before(&text_str, content_type);

Ok(())
Ok(text_chunk.as_str().to_string())
}

fn after(&self, args: &[Value]) -> Result<(), Error> {
fn after(&self, args: &[Value]) -> Result<String, Error> {
let mut binding = self.0.borrow_mut();
let text_chunk = binding.text_chunk.get_mut().unwrap();

Expand All @@ -91,10 +91,10 @@ impl SelmaHTMLTextChunk {

text_chunk.after(&text_str, content_type);

Ok(())
Ok(text_chunk.as_str().to_string())
}

fn replace(&self, args: &[Value]) -> Result<(), Error> {
fn replace(&self, args: &[Value]) -> Result<String, Error> {
let mut binding = self.0.borrow_mut();
let text_chunk = binding.text_chunk.get_mut().unwrap();

Expand All @@ -105,7 +105,7 @@ impl SelmaHTMLTextChunk {

text_chunk.replace(&text_str, content_type);

Ok(())
Ok(text_chunk.as_str().to_string())
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/selma/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Selma
VERSION = "0.4.5"
VERSION = "0.4.6"
end

0 comments on commit ad6cfd7

Please sign in to comment.