fn find_storage_provider(
    capabilities: &Vec<CapabilityDecl>,
    name: &CapabilityName,
) -> Option<String> {
    for decl in capabilities {
        match decl {
            CapabilityDecl::Storage(decl) if &decl.name == name => match &decl.source {
                StorageDirectorySource::Child(child) => {
                    return Some(child.to_string());
                }
                StorageDirectorySource::Self_ | StorageDirectorySource::Parent => {
                    return None;
                }
            },
            _ => {}
        }
    }
    None
}
/// Examines a group of StorageDecls looking for one whose name matches the
/// String passed in and whose source is a child. `None` is returned if either
/// no declaration has the specified name or the declaration represents an
/// offer from Self or Parent.
Examines a group of StorageDecls looking for one whose name matches the
String passed in and whose source is a child. `None` is returned if either
no declaration has the specified name or the declaration represents an
offer from Self or Parent.
Examines a group of StorageDecls looking for one whose name matches the String passed in and whose source is a child . ` None ` is returned if either no declaration has the specified name or the declaration represents an offer from Self or Parent .
fn find_storage_provider(
    capabilities: &Vec<CapabilityDecl>,
    name: &CapabilityName,
) -> Option<String> {
    for decl in capabilities {
        match decl {
            CapabilityDecl::Storage(decl) if &decl.name == name => match &decl.source {
                StorageDirectorySource::Child(child) => {
                    return Some(child.to_string());
                }
                StorageDirectorySource::Self_ | StorageDirectorySource::Parent => {
                    return None;
                }
            },
            _ => {}
        }
    }
    None
}
fn find_storage_provider ( capabilities : & Vec < CapabilityDecl > , name : & CapabilityName , ) -> Option < String > { for decl in capabilities { match decl { CapabilityDecl :: Storage ( decl ) if & decl . name == name => match & decl . source { StorageDirectorySource :: Child ( child ) => { return Some ( child . to_string ( ) ) ; } StorageDirectorySource :: Self_ | StorageDirectorySource :: Parent => { return None ; } } , _ => { } } } None }
Examines a group of StorageDecls looking for one whose name matches the
String passed in and whose source is a child.
Examines a group of StorageDecls looking for one whose name matches the String passed in and whose source is a child .
capabilities
&Vec<CapabilityDecl>
name
&CapabilityName
capabilities
&Vec<CapabilityDecl>
name
&CapabilityName