There are two functions:
impl PipelineLayout {
pub fn descriptor_set_layouts(&self) -> &[Arc<DescriptorSetLayout>]
}
and
impl PersistentDescriptorSet {
pub fn start(layout: Arc<DescriptorSetLayout>) -> PersistentDescriptorSetBuilder
}
I want to pass the first element of the array returned by the first function as the parameter to the second function, however I can't create an Arc
on it because of the reference:
let layout: Arc<DescriptorSetLayout> = foo().descriptor_set_layouts().get(0)
.expect("Couldn't find layout descriptor 0.");
// error[E0308]: mismatched types
// --> src/main.rs:72:44
// |
// 72 | let layout: Arc<DescriptorSetLayout> = foo().descriptor_set_layouts().get(0)
// | _________________------------------------___^
// | | |
// | | expected due to this
// 73 | | .expect("Couldn't find layout descriptor 0.");
// | |_____________________________________________________^ expected struct `Arc`, found reference
// |
// = note: expected struct `Arc<DescriptorSetLayout>`
// found reference `&Arc<DescriptorSetLayout>`
How can I get an Arc
on an element of that array (or any other way to pass an element of that array to the second function)?