Skip to content

Commit

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

Broaden scope of suppressed warnings for listings without a main fn
  • Loading branch information
ehuss committed Apr 18, 2020
2 parents 4bfaefd + c8b01e9 commit 241eae4
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 241eae4

Please sign in to comment.