remove unused Resource bound

This commit is contained in:
teoxoy 2024-06-26 17:45:07 +02:00 committed by Teodor Tanasoaia
parent 727956fcde
commit 985968fd38

View File

@ -1,6 +1,5 @@
//! The `ResourceMetadata` type.
use crate::resource::Resource;
use bit_vec::BitVec;
use std::{borrow::Cow, mem, sync::Arc};
use wgt::strict_assert;
@ -13,7 +12,7 @@ use wgt::strict_assert;
/// members, but a bit vector tracks occupancy, so iteration touches
/// only occupied elements.
#[derive(Debug)]
pub(super) struct ResourceMetadata<T: Resource> {
pub(super) struct ResourceMetadata<T> {
/// If the resource with index `i` is a member, `owned[i]` is `true`.
owned: BitVec<usize>,
@ -21,7 +20,7 @@ pub(super) struct ResourceMetadata<T: Resource> {
resources: Vec<Option<Arc<T>>>,
}
impl<T: Resource> ResourceMetadata<T> {
impl<T> ResourceMetadata<T> {
pub(super) fn new() -> Self {
Self {
owned: BitVec::default(),
@ -175,13 +174,13 @@ impl<T: Resource> ResourceMetadata<T> {
///
/// This is used to abstract over the various places
/// trackers can get new resource metadata from.
pub(super) enum ResourceMetadataProvider<'a, T: Resource> {
pub(super) enum ResourceMetadataProvider<'a, T> {
/// Comes directly from explicit values.
Direct { resource: Cow<'a, Arc<T>> },
/// Comes from another metadata tracker.
Indirect { metadata: &'a ResourceMetadata<T> },
}
impl<T: Resource> ResourceMetadataProvider<'_, T> {
impl<T> ResourceMetadataProvider<'_, T> {
/// Get a reference to the resource from this.
///
/// # Safety