about summary refs log tree commit diff
diff options
context:
space:
mode:
authorr00ster91 <r00ster91@protonmail.com>2021-10-17 12:04:01 +0200
committerr00ster91 <r00ster91@protonmail.com>2021-10-17 12:04:01 +0200
commit599d9126a292d1f6944e473b1d47dde65cb7f993 (patch)
tree8e8832be989cdb8084c7b23203f8b1f91dd6b3db
parent049ab82662d4f63bd88bdcba97b172421f906dd5 (diff)
downloadrust-599d9126a292d1f6944e473b1d47dde65cb7f993.tar.gz
rust-599d9126a292d1f6944e473b1d47dde65cb7f993.zip
Some "parenthesis" and "parentheses" fixes
-rw-r--r--clippy_lints/src/manual_unwrap_or.rs2
-rw-r--r--clippy_utils/src/sugg.rs6
-rw-r--r--tests/ui/manual_unwrap_or.fixed4
-rw-r--r--tests/ui/manual_unwrap_or.rs4
-rw-r--r--tests/ui/useless_conversion.fixed2
-rw-r--r--tests/ui/useless_conversion.rs2
6 files changed, 10 insertions, 10 deletions
diff --git a/clippy_lints/src/manual_unwrap_or.rs b/clippy_lints/src/manual_unwrap_or.rs
index 2ae9cb4f9c1..42478e3416e 100644
--- a/clippy_lints/src/manual_unwrap_or.rs
+++ b/clippy_lints/src/manual_unwrap_or.rs
@@ -98,7 +98,7 @@ fn lint_manual_unwrap_or<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
                 reindent_multiline(or_body_snippet.into(), true, Some(indent));
 
             let suggestion = if scrutinee.span.from_expansion() {
-                    // we don't want parenthesis around macro, e.g. `(some_macro!()).unwrap_or(0)`
+                    // we don't want parentheses around macro, e.g. `(some_macro!()).unwrap_or(0)`
                     sugg::Sugg::hir_with_macro_callsite(cx, scrutinee, "..")
                 }
                 else {
diff --git a/clippy_utils/src/sugg.rs b/clippy_utils/src/sugg.rs
index 5b0efb1fd71..01fb944cc36 100644
--- a/clippy_utils/src/sugg.rs
+++ b/clippy_utils/src/sugg.rs
@@ -16,10 +16,10 @@ use std::convert::TryInto;
 use std::fmt::Display;
 use std::ops::{Add, Neg, Not, Sub};
 
-/// A helper type to build suggestion correctly handling parenthesis.
+/// A helper type to build suggestion correctly handling parentheses.
 #[derive(Clone, PartialEq)]
 pub enum Sugg<'a> {
-    /// An expression that never needs parenthesis such as `1337` or `[0; 42]`.
+    /// An expression that never needs parentheses such as `1337` or `[0; 42]`.
     NonParen(Cow<'a, str>),
     /// An expression that does not fit in other variants.
     MaybeParen(Cow<'a, str>),
@@ -283,7 +283,7 @@ impl<'a> Sugg<'a> {
         }
     }
 
-    /// Adds parenthesis to any expression that might need them. Suitable to the
+    /// Adds parentheses to any expression that might need them. Suitable to the
     /// `self` argument of a method call
     /// (e.g., to build `bar.foo()` or `(1 + 2).foo()`).
     pub fn maybe_par(self) -> Self {
diff --git a/tests/ui/manual_unwrap_or.fixed b/tests/ui/manual_unwrap_or.fixed
index 3717f962745..05d6c56f2ac 100644
--- a/tests/ui/manual_unwrap_or.fixed
+++ b/tests/ui/manual_unwrap_or.fixed
@@ -74,10 +74,10 @@ fn result_unwrap_or() {
     let a = Ok::<i32, &str>(1);
     a.unwrap_or(42);
 
-    // int case, suggestion must surround Result expr with parenthesis
+    // int case, suggestion must surround Result expr with parentheses
     (Ok(1) as Result<i32, &str>).unwrap_or(42);
 
-    // method call case, suggestion must not surround Result expr `s.method()` with parenthesis
+    // method call case, suggestion must not surround Result expr `s.method()` with parentheses
     struct S {}
     impl S {
         fn method(self) -> Option<i32> {
diff --git a/tests/ui/manual_unwrap_or.rs b/tests/ui/manual_unwrap_or.rs
index 989adde1f5b..09f62c69b71 100644
--- a/tests/ui/manual_unwrap_or.rs
+++ b/tests/ui/manual_unwrap_or.rs
@@ -95,13 +95,13 @@ fn result_unwrap_or() {
         Err(_) => 42,
     };
 
-    // int case, suggestion must surround Result expr with parenthesis
+    // int case, suggestion must surround Result expr with parentheses
     match Ok(1) as Result<i32, &str> {
         Ok(i) => i,
         Err(_) => 42,
     };
 
-    // method call case, suggestion must not surround Result expr `s.method()` with parenthesis
+    // method call case, suggestion must not surround Result expr `s.method()` with parentheses
     struct S {}
     impl S {
         fn method(self) -> Option<i32> {
diff --git a/tests/ui/useless_conversion.fixed b/tests/ui/useless_conversion.fixed
index 76aa82068d6..70ff08f3655 100644
--- a/tests/ui/useless_conversion.fixed
+++ b/tests/ui/useless_conversion.fixed
@@ -66,7 +66,7 @@ fn main() {
     let _ = vec![1, 2, 3].into_iter();
     let _: String = format!("Hello {}", "world");
 
-    // keep parenthesis around `a + b` for suggestion (see #4750)
+    // keep parentheses around `a + b` for suggestion (see #4750)
     let a: i32 = 1;
     let b: i32 = 1;
     let _ = (a + b) * 3;
diff --git a/tests/ui/useless_conversion.rs b/tests/ui/useless_conversion.rs
index ccee7abb404..f2444a8f436 100644
--- a/tests/ui/useless_conversion.rs
+++ b/tests/ui/useless_conversion.rs
@@ -66,7 +66,7 @@ fn main() {
     let _ = vec![1, 2, 3].into_iter().into_iter();
     let _: String = format!("Hello {}", "world").into();
 
-    // keep parenthesis around `a + b` for suggestion (see #4750)
+    // keep parentheses around `a + b` for suggestion (see #4750)
     let a: i32 = 1;
     let b: i32 = 1;
     let _ = i32::from(a + b) * 3;