Skip to content

Commit

Permalink
Merge pull request #1195 from englishm/me/suppress-more-warnings-for-…
Browse files Browse the repository at this point in the history
…small-listings

Broaden scope of suppressed warnings for listings without a main fn
  • Loading branch information
ehuss authored Apr 18, 2020
2 parents 8e673c9 + 1d265fd commit 04c04df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ fn add_playpen_pre(html: &str, playpen_config: &Playpen) -> String {
let (attrs, code) = partition_source(code);

format!(
"\n# #![allow(unused_variables)]\n{}#fn main() {{\n{}#}}",
"\n# #![allow(unused)]\n{}#fn main() {{\n{}#}}",
attrs, code
)
.into()
Expand Down Expand Up @@ -756,7 +756,7 @@ mod tests {
fn add_playpen() {
let inputs = [
("<code class=\"language-rust\">x()</code>",
"<pre class=\"playpen\"><code class=\"language-rust\">\n<span class=\"boring\">#![allow(unused_variables)]\n</span><span class=\"boring\">fn main() {\n</span>x()\n<span class=\"boring\">}\n</span></code></pre>"),
"<pre class=\"playpen\"><code class=\"language-rust\">\n<span class=\"boring\">#![allow(unused)]\n</span><span class=\"boring\">fn main() {\n</span>x()\n<span class=\"boring\">}\n</span></code></pre>"),
("<code class=\"language-rust\">fn main() {}</code>",
"<pre class=\"playpen\"><code class=\"language-rust\">fn main() {}\n</code></pre>"),
("<code class=\"language-rust editable\">let s = \"foo\n # bar\n\";</code>",
Expand Down

0 comments on commit 04c04df

Please sign in to comment.