Skip to content

Commit

Permalink
shange snippet_opt to snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
basil-cow committed Nov 13, 2019
1 parent 590854a commit 1f91752
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/large_stack_arrays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc::{declare_tool_lint, impl_lint_pass};
use if_chain::if_chain;

use crate::rustc_target::abi::LayoutOf;
use crate::utils::{snippet_opt, span_help_and_lint};
use crate::utils::{snippet, span_help_and_lint};

declare_clippy_lint! {
/// **What it does:** Checks for local arrays that may be too large.
Expand Down Expand Up @@ -58,7 +58,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LargeStackArrays {
),
&format!(
"consider allocating on the heap with vec!{}.into_boxed_slice()",
snippet_opt(cx, expr.span).as_ref().map_or("[...]", String::as_str)
snippet(cx, expr.span, "[...]")
),
);
}
Expand Down

0 comments on commit 1f91752

Please sign in to comment.