about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjoboet <jonasboettiger@icloud.com>2024-05-23 13:38:52 +0200
committerjoboet <jonasboettiger@icloud.com>2024-05-23 13:38:52 +0200
commitc398b2c1933f284977cdc4e3866d8c67649cd581 (patch)
tree76e906ac45d55a57d8d2012e9641bd4ff3d3bde5
parentfde4a22da21e9d9b1488f075eae0092a4d0f93d0 (diff)
downloadrust-c398b2c1933f284977cdc4e3866d8c67649cd581.tar.gz
rust-c398b2c1933f284977cdc4e3866d8c67649cd581.zip
core: use `Copy` in TAIT to fix clippy lint
-rw-r--r--library/core/src/slice/ascii.rs2
-rw-r--r--library/core/src/str/mod.rs18
2 files changed, 10 insertions, 10 deletions
diff --git a/library/core/src/slice/ascii.rs b/library/core/src/slice/ascii.rs
index 20f5e321d4f..19c91ba2eb9 100644
--- a/library/core/src/slice/ascii.rs
+++ b/library/core/src/slice/ascii.rs
@@ -190,7 +190,7 @@ impl [u8] {
     }
 }
 
-type EscapeByte = impl (Fn(&u8) -> ascii::EscapeDefault) + Clone;
+type EscapeByte = impl (Fn(&u8) -> ascii::EscapeDefault) + Copy;
 
 /// An iterator over the escaped version of a byte slice.
 ///
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index 3e8cccd5c18..edda4d1b687 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -2764,15 +2764,15 @@ impl Default for &mut str {
     }
 }
 
-type LinesMap = impl (Fn(&str) -> &str) + Clone;
-type CharEscapeDebugContinue = impl (FnMut(char) -> char::EscapeDebug) + Clone;
-type CharEscapeUnicode = impl (Fn(char) -> char::EscapeUnicode) + Clone;
-type CharEscapeDefault = impl (Fn(char) -> char::EscapeDefault) + Clone;
-type IsWhitespace = impl (Fn(char) -> bool) + Clone;
-type IsAsciiWhitespace = impl (Fn(&u8) -> bool) + Clone;
-type IsNotEmpty = impl (Fn(&&str) -> bool) + Clone;
-type BytesIsNotEmpty<'a> = impl (FnMut(&&'a [u8]) -> bool) + Clone;
-type UnsafeBytesToStr<'a> = impl (FnMut(&'a [u8]) -> &'a str) + Clone;
+type LinesMap = impl (Fn(&str) -> &str) + Copy;
+type CharEscapeDebugContinue = impl (FnMut(char) -> char::EscapeDebug) + Copy;
+type CharEscapeUnicode = impl (Fn(char) -> char::EscapeUnicode) + Copy;
+type CharEscapeDefault = impl (Fn(char) -> char::EscapeDefault) + Copy;
+type IsWhitespace = impl (Fn(char) -> bool) + Copy;
+type IsAsciiWhitespace = impl (Fn(&u8) -> bool) + Copy;
+type IsNotEmpty = impl (Fn(&&str) -> bool) + Copy;
+type BytesIsNotEmpty<'a> = impl (FnMut(&&'a [u8]) -> bool) + Copy;
+type UnsafeBytesToStr<'a> = impl (FnMut(&'a [u8]) -> &'a str) + Copy;
 
 // This is required to make `impl From<&str> for Box<dyn Error>` and `impl<E> From<E> for Box<dyn Error>` not overlap.
 #[stable(feature = "rust1", since = "1.0.0")]