about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics/plugin.rs
diff options
context:
space:
mode:
authorAndre Bogus <bogusandre@gmail.com>2017-05-13 21:40:06 +0200
committerAndre Bogus <bogusandre@gmail.com>2017-05-15 23:56:09 +0200
commit958c67d9c8ca74370e2052fd8a3d209b8184d1f4 (patch)
tree8f89d2dddd401827953e94e8c3e8a0086a8fb068 /src/libsyntax/diagnostics/plugin.rs
parenta9c163ebe9deeaf74699fc8642d919cdb2b5e617 (diff)
downloadrust-958c67d9c8ca74370e2052fd8a3d209b8184d1f4.tar.gz
rust-958c67d9c8ca74370e2052fd8a3d209b8184d1f4.zip
adressed comments by @kennytm and @petrochenkov
Diffstat (limited to 'src/libsyntax/diagnostics/plugin.rs')
-rw-r--r--src/libsyntax/diagnostics/plugin.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs
index ca89a80fdee..73aeb40df84 100644
--- a/src/libsyntax/diagnostics/plugin.rs
+++ b/src/libsyntax/diagnostics/plugin.rs
@@ -111,7 +111,7 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
     // overflow the maximum line width.
     description.map(|raw_msg| {
         let msg = raw_msg.as_str();
-        if !msg.starts_with('\n') || !msg.ends_with('\n') {
+        if !msg.starts_with("\n") || !msg.ends_with("\n") {
             ecx.span_err(span, &format!(
                 "description for error code {} doesn't start and end with a newline",
                 code
@@ -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!(