chiark / gitweb /
Remove some otiose lifetimes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Feb 2024 12:37:51 +0000 (12:37 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Feb 2024 14:24:38 +0000 (14:24 +0000)
clippy complains about this (but we're going to suppress the lint, and
maybe we want to keep them sometimes).

src/coloured_string.rs

index 01221cae8ec673c76bfa30fd212a53c9c733d468..3d902579994db0f25d9047493d5e194a1e25e285 100644 (file)
@@ -15,7 +15,7 @@ pub trait ColouredStringCommon {
         UnicodeWidthStr::width(self.text())
     }
 
-    fn slice<'a>(&'a self) -> ColouredStringSlice<'a> {
+    fn slice(&self) -> ColouredStringSlice {
         ColouredStringSlice {
             text: self.text(),
             colours: self.colours(),
@@ -26,21 +26,21 @@ pub trait ColouredStringCommon {
         self.split(width).next().unwrap()
     }
 
-    fn chars<'a>(&'a self) -> ColouredStringCharIterator<'a> {
+    fn chars(&self) -> ColouredStringCharIterator {
         ColouredStringCharIterator {
             cs: self.slice(),
             textpos: 0,
             colourpos: 0,
         }
     }
-    fn frags<'a>(&'a self) -> ColouredStringFragIterator<'a> {
+    fn frags(&self) -> ColouredStringFragIterator {
         ColouredStringFragIterator {
             cs: self.slice(),
             textpos: 0,
             colourpos: 0,
         }
     }
-    fn split<'a>(&'a self, width: usize) -> ColouredStringSplitIterator<'a> {
+    fn split(&self, width: usize) -> ColouredStringSplitIterator {
         ColouredStringSplitIterator {
             cs: self.slice(),
             width,