xbase-lab / xcodeproj

XcodeProj parser and data representation
5 stars 2 forks source link

make collections a HashSet of PBXObject with identifier included? #3

Closed github-actions[bot] closed 2 years ago

github-actions[bot] commented 2 years ago

https://github.com/tami5/xcodeproj/blob/304cada7cc54fd2e930e3fb447ca0f7841c10610/src/pbxproj/object/collection.rs#L15


#[derive(Default, Debug, derive_new::new, derive_deref_rs::Deref)]
pub struct PBXObjectCollection(pub(crate) HashMap<String, PBXObject>);

/// TODO: make collections a HashSet of PBXObject with identifier included?
impl PBXObjectCollection {
    pub(crate) fn set_inner(&mut self, map: HashMap<String, PBXObject>) {
        self.0 = map;
    }

    /// Add new object. same as insert but it auto create id and returns it
    pub fn push<O: Into<PBXObject>>(&mut self, object: O) -> String {
        let id = uuid::Uuid::new_v4().to_string();
github-actions[bot] commented 2 years ago

Closed in 8c045ae1e0da9cf6ae7204eb8b5d9e036291bccf