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

OpteAdm duplicates a significant amount of code from OpteHdl #529

Open
FelixMcFelix opened this issue May 13, 2024 · 0 comments
Open

OpteAdm duplicates a significant amount of code from OpteHdl #529

FelixMcFelix opened this issue May 13, 2024 · 0 comments
Labels
cleanup Code cleanliness

Comments

@FelixMcFelix
Copy link
Collaborator

Currently, ioctls are implemented identically between both OpteAdm (bin/opteadm/src/lib.rs) and OpteHdl(lib/opte-ioctl/src/lib.rs), and each has several ioctls that the other does not. All of this functionality should be implemented once on OpteHdl. OpteAdm could instead be used instead to contain any equivalent methods for CLI-specific types, if needed:

pub struct OpteAdm(OpteHdl);

impl Deref for OpteAdm {
    type Target = OpteHdl;

    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

impl OpteAdm {
    // ... CLI-specific convenience/conversion methods ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanliness
Projects
None yet
Development

No branches or pull requests

1 participant