Commit 26802bab55

26802bab55f6f955b21a950ecc119c7d39ab949e

parent: fd3fef5c9e

Unregistered key

VAWVAW <94846592+VAWVAW@users.noreply.github.com> · 2025-05-29 02:59 UTC
committer: <noreply@github.com>

Fix Clippy warnings for 1.83 (#429)

Layout: unified · split

src/base.rs +4 −4
@@ -293,7 +293,7 @@ impl<'de> Deserialize<'de> for SortColumn<SortFieldRoom> {
293/// [serde] visitor for deserializing [SortColumn] for rooms and spaces. 293/// [serde] visitor for deserializing [SortColumn] for rooms and spaces.
294struct SortRoomVisitor; 294struct SortRoomVisitor;
295 295
296impl<'de> Visitor<'de> for SortRoomVisitor { 296impl Visitor<'_> for SortRoomVisitor {
297 type Value = SortColumn<SortFieldRoom>; 297 type Value = SortColumn<SortFieldRoom>;
298 298
299 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 299 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -346,7 +346,7 @@ impl<'de> Deserialize<'de> for SortColumn<SortFieldUser> {
346/// [serde] visitor for deserializing [SortColumn] for users. 346/// [serde] visitor for deserializing [SortColumn] for users.
347struct SortUserVisitor; 347struct SortUserVisitor;
348 348
349impl<'de> Visitor<'de> for SortUserVisitor { 349impl Visitor<'_> for SortUserVisitor {
350 type Value = SortColumn<SortFieldUser>; 350 type Value = SortColumn<SortFieldUser>;
351 351
352 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 352 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -1182,7 +1182,7 @@ impl RoomInfo {
1182 1182
1183 /// Indicates whether we've recently fetched scrollback for this room. 1183 /// Indicates whether we've recently fetched scrollback for this room.
1184 pub fn recently_fetched(&self) -> bool { 1184 pub fn recently_fetched(&self) -> bool {
1185 self.fetch_last.map_or(false, |i| i.elapsed() < ROOM_FETCH_DEBOUNCE) 1185 self.fetch_last.is_some_and(|i| i.elapsed() < ROOM_FETCH_DEBOUNCE)
1186 } 1186 }
1187 1187
1188 fn clear_receipt(&mut self, user_id: &OwnedUserId) -> Option<()> { 1188 fn clear_receipt(&mut self, user_id: &OwnedUserId) -> Option<()> {
@@ -1609,7 +1609,7 @@ impl<'de> Deserialize<'de> for IambId {
1609/// [serde] visitor for deserializing [IambId]. 1609/// [serde] visitor for deserializing [IambId].
1610struct IambIdVisitor; 1610struct IambIdVisitor;
1611 1611
1612impl<'de> Visitor<'de> for IambIdVisitor { 1612impl Visitor<'_> for IambIdVisitor {
1613 type Value = IambId; 1613 type Value = IambId;
1614 1614
1615 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 1615 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
src/config.rs +6 −6
@@ -98,7 +98,7 @@ fn validate_profile_name(name: &str) -> bool {
98 98
99 let mut chars = name.chars(); 99 let mut chars = name.chars();
100 100
101 if !chars.next().map_or(false, |c| c.is_ascii_alphanumeric()) { 101 if !chars.next().is_some_and(|c| c.is_ascii_alphanumeric()) {
102 return false; 102 return false;
103 } 103 }
104 104
@@ -152,7 +152,7 @@ pub enum ConfigError {
152pub struct Keys(pub Vec<TerminalKey>, pub String); 152pub struct Keys(pub Vec<TerminalKey>, pub String);
153pub struct KeysVisitor; 153pub struct KeysVisitor;
154 154
155impl<'de> Visitor<'de> for KeysVisitor { 155impl Visitor<'_> for KeysVisitor {
156 type Value = Keys; 156 type Value = Keys;
157 157
158 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 158 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -183,7 +183,7 @@ impl<'de> Deserialize<'de> for Keys {
183pub struct VimModes(pub Vec<VimMode>); 183pub struct VimModes(pub Vec<VimMode>);
184pub struct VimModesVisitor; 184pub struct VimModesVisitor;
185 185
186impl<'de> Visitor<'de> for VimModesVisitor { 186impl Visitor<'_> for VimModesVisitor {
187 type Value = VimModes; 187 type Value = VimModes;
188 188
189 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 189 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -233,7 +233,7 @@ impl From<LogLevel> for Level {
233 } 233 }
234} 234}
235 235
236impl<'de> Visitor<'de> for LogLevelVisitor { 236impl Visitor<'_> for LogLevelVisitor {
237 type Value = LogLevel; 237 type Value = LogLevel;
238 238
239 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 239 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -268,7 +268,7 @@ impl<'de> Deserialize<'de> for LogLevel {
268pub struct UserColor(pub Color); 268pub struct UserColor(pub Color);
269pub struct UserColorVisitor; 269pub struct UserColorVisitor;
270 270
271impl<'de> Visitor<'de> for UserColorVisitor { 271impl Visitor<'_> for UserColorVisitor {
272 type Value = UserColor; 272 type Value = UserColor;
273 273
274 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 274 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -419,7 +419,7 @@ impl Default for NotifyVia {
419 } 419 }
420} 420}
421 421
422impl<'de> Visitor<'de> for NotifyViaVisitor { 422impl Visitor<'_> for NotifyViaVisitor {
423 type Value = NotifyVia; 423 type Value = NotifyVia;
424 424
425 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 425 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
src/windows/room/chat.rs +1 −1
@@ -906,7 +906,7 @@ impl<'a> Chat<'a> {
906 } 906 }
907} 907}
908 908
909impl<'a> StatefulWidget for Chat<'a> { 909impl StatefulWidget for Chat<'_> {
910 type State = ChatState; 910 type State = ChatState;
911 911
912 fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) { 912 fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
src/windows/room/scrollback.rs +1 −1
@@ -1284,7 +1284,7 @@ impl<'a> Scrollback<'a> {
1284 } 1284 }
1285} 1285}
1286 1286
1287impl<'a> StatefulWidget for Scrollback<'a> { 1287impl StatefulWidget for Scrollback<'_> {
1288 type State = ScrollbackState; 1288 type State = ScrollbackState;
1289 1289
1290 fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) { 1290 fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State) {
src/windows/room/space.rs +1 −1
@@ -184,7 +184,7 @@ impl<'a> Space<'a> {
184 } 184 }
185} 185}
186 186
187impl<'a> StatefulWidget for Space<'a> { 187impl StatefulWidget for Space<'_> {
188 type State = SpaceState; 188 type State = SpaceState;
189 189
190 fn render(self, area: Rect, buffer: &mut Buffer, state: &mut Self::State) { 190 fn render(self, area: Rect, buffer: &mut Buffer, state: &mut Self::State) {