Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear name for pack/pack_file/count_xxx #27

Open
unkcpz opened this issue Jan 24, 2025 · 0 comments
Open

Clear name for pack/pack_file/count_xxx #27

unkcpz opened this issue Jan 24, 2025 · 0 comments

Comments

@unkcpz
Copy link
Owner

unkcpz commented Jan 24, 2025

    // XXX: combine with get_n_objs and return dicts
    fn get_total_size(&self) -> PyResult<u64> {
        let info = rsdos::cli::stat(&self.inner)?;
        Ok(info.size.loose)
    }

    // FIXME: rename count_loose
    fn get_n_objs(&self) -> PyResult<u64> {
        let info = rsdos::cli::stat(&self.inner)?;
        Ok(info.count.loose)
    }

    fn get_count_pack(&self) -> PyResult<u64> {
        let info = rsdos::cli::stat(&self.inner)?;
        Ok(info.count.packs)
    }

    fn get_count_pack_file(&self) -> PyResult<u64> {
        let info = rsdos::cli::stat(&self.inner)?;
        Ok(info.count.packs_file)
    }

prefix get_ is confuse and not necessary.

    Ok(ContainerInfo {
        location: cnt.path.display().to_string(),
        id: config.container_id.to_string(),
        compression_algorithm: config.compression_algorithm,
        count: CountInfo {
            // number of loose objs
            loose: loose_files_count,
            // number of pack objs
            // FIXME: rename -> pack
            packs: packs_count,
            // number of pack files
            packs_file: packs_file_count,
        },
        size: SizeInfo {
            // total size of all loose objs
            loose: loose_files_size,
            // total size of all pack objs
            packs: packs_size,
            // total size of all pack files
            packs_file: packs_file_size,
            // size of pack index db file
            packs_db: packs_db_size,
        },
    })

prefer pack_file over packs_file?
prefer count.pack_obj over count.packs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant