clippy: Fix len_zero warnings (#31935)

This commit is contained in:
Oluwatobi Sofela 2024-03-29 11:05:20 +01:00 committed by GitHub
parent 49c6b2668f
commit c3b6d40f90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 7 deletions

View file

@ -213,7 +213,7 @@ impl Performance {
let buffer = self.buffer.borrow();
let mut new_entries =
buffer.get_entries_by_name_and_type(None, Some(entry_type.clone()));
if new_entries.len() > 0 {
if !new_entries.is_empty() {
let mut obs_entries = observer.entries();
obs_entries.append(&mut new_entries);
observer.set_entries(obs_entries);
@ -408,7 +408,7 @@ impl PerformanceMethods for Performance {
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html#performance-timing-attribute
fn Timing(&self) -> DomRoot<PerformanceNavigationTiming> {
let entries = self.GetEntriesByType(DOMString::from("navigation"));
if entries.len() > 0 {
if !entries.is_empty() {
return DomRoot::from_ref(
entries[0]
.downcast::<PerformanceNavigationTiming>()