about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics/plugin.rs
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2017-05-16 17:31:50 -0600
committerGitHub <noreply@github.com>2017-05-16 17:31:50 -0600
commit4066c8ec718d8338c2fd6e00cb63e03d3544bcd1 (patch)
tree7c6d8f39d6a240fa52d1b33e67c16ffa51f5040e /src/libsyntax/diagnostics/plugin.rs
parent8f61055c529d12a04ee077ad42a80b9f9b952cb1 (diff)
parent282b40249e158376fcc4682879be40fb80c4e36f (diff)
downloadrust-4066c8ec718d8338c2fd6e00cb63e03d3544bcd1.tar.gz
rust-4066c8ec718d8338c2fd6e00cb63e03d3544bcd1.zip
Rollup merge of #41957 - llogiq:clippy-libsyntax, r=petrochenkov
Fix some clippy warnings in libsyntax

This is mostly removing stray ampersands, needless returns and lifetimes. Basically a lot of small changes.
Diffstat (limited to 'src/libsyntax/diagnostics/plugin.rs')
-rw-r--r--src/libsyntax/diagnostics/plugin.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs
index fe5cb87ad59..73aeb40df84 100644
--- a/src/libsyntax/diagnostics/plugin.rs
+++ b/src/libsyntax/diagnostics/plugin.rs
@@ -120,7 +120,7 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
 
         // URLs can be unavoidably longer than the line limit, so we allow them.
         // Allowed format is: `[name]: https://www.rust-lang.org/`
-        let is_url = |l: &str| l.starts_with('[') && l.contains("]:") && l.contains("http");
+        let is_url = |l: &str| l.starts_with("[") && l.contains("]:") && l.contains("http");
 
         if msg.lines().any(|line| line.len() > MAX_DESCRIPTION_WIDTH && !is_url(line)) {
             ecx.span_err(span, &format!(
@@ -177,7 +177,7 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
             if let Err(e) = output_metadata(ecx,
                                             &target_triple,
                                             &crate_name.name.as_str(),
-                                            &diagnostics) {
+                                            diagnostics) {
                 ecx.span_bug(span, &format!(
                     "error writing metadata for triple `{}` and crate `{}`, error: {}, \
                      cause: {:?}",
@@ -227,7 +227,7 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
 
     MacEager::items(SmallVector::many(vec![
         P(ast::Item {
-            ident: name.clone(),
+            ident: *name,
             attrs: Vec::new(),
             id: ast::DUMMY_NODE_ID,
             node: ast::ItemKind::Const(