Skip to content

Commit 3b46c74

Browse files
committed
Try fixing dead code warnings
1 parent dd0fbc3 commit 3b46c74

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tokio/src/runtime/task/list.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ impl<S: 'static> OwnedTasks<S> {
157157
}
158158
}
159159

160-
pub(crate) fn active_tasks_count(&self) -> usize {
161-
self.inner.lock().list.count()
160+
cfg_metrics! {
161+
pub(crate) fn active_tasks_count(&self) -> usize {
162+
self.inner.lock().list.count()
163+
}
162164
}
163165

164166
pub(crate) fn remove(&self, task: &Task<S>) -> Option<Task<S>> {

tokio/src/util/linked_list.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ impl<L: Link> CountedLinkedList<L, L::Target> {
270270
val
271271
}
272272

273+
#[cfg(any(all(tokio_unstable, not(loom), feature = "stats"), test))]
273274
pub(crate) fn count(&self) -> usize {
274275
self.count
275276
}

0 commit comments

Comments
 (0)