Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtorikian committed Jan 3, 2024
1 parent d5f4bd2 commit 74c3744
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions ext/selma/src/rewriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ pub struct SelmaRewriter(std::cell::RefCell<Rewriter>);
type RewriterValues = (Option<Option<Obj<SelmaSanitizer>>>, Option<RArray>);

impl SelmaRewriter {
const SELMA_ON_END_TAG: &str = "on_end_tag";
const SELMA_HANDLE_ELEMENT: &str = "handle_element";
const SELMA_HANDLE_TEXT_CHUNK: &str = "handle_text_chunk";
const SELMA_ON_END_TAG: &'static str = "on_end_tag";
const SELMA_HANDLE_ELEMENT: &'static str = "handle_element";
const SELMA_HANDLE_TEXT_CHUNK: &'static str = "handle_text_chunk";

/// @yard
/// @def new(sanitizer: Selma::Sanitizer.new(Selma::Sanitizer::Config::DEFAULT), handlers: [])
Expand All @@ -56,13 +56,14 @@ impl SelmaRewriter {

let sanitizer = match rb_sanitizer {
None => {
// no `sanitizer:` provided, use default
let default_sanitizer = SelmaSanitizer::new(&[])?;
let wrapped_sanitizer = Obj::wrap(default_sanitizer);
wrapped_sanitizer.funcall::<&str, (), Value>("setup", ())?;
Some(wrapped_sanitizer.get().to_owned())
}
Some(sanitizer_value) => match sanitizer_value {
None => None,
None => None, // no `sanitizer:` provided, use default
Some(sanitizer) => {
sanitizer.funcall::<&str, (), Value>("setup", ())?;
Some(sanitizer.get().to_owned())
Expand Down
2 changes: 1 addition & 1 deletion ext/selma/src/tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl Tag {
|| tag.index == HTMLTag::XMP as usize
}

pub const ESCAPEWORTHY_TAGS_CSS: &str =
pub const ESCAPEWORTHY_TAGS_CSS: &'static str =
"title, textarea, style, xmp, iframe, noembed, noframes, script, plaintext";

pub fn html_tags() -> Vec<HTMLTag> {
Expand Down

0 comments on commit 74c3744

Please sign in to comment.