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

args: Remove impl Deref for ArgsCollection #60

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//! arguments for `gccrs`.

use std::convert::TryFrom;
use std::ops::Deref;
use std::path::{Path, PathBuf};

use getopts::Matches;
Expand Down Expand Up @@ -72,11 +71,9 @@ impl TryFrom<&RustcArgs> for ArgsCollection {
}
}

/// Implement deref on the collection so we can easily iterate on it
impl Deref for ArgsCollection {
type Target = Vec<Args>;

fn deref(&self) -> &Self::Target {
impl ArgsCollection {
/// Access the collection's inner data
pub fn data(&self) -> &Vec<Args> {
&self.args_set
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gccrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Gccrs {
let rustc_args = RustcArgs::try_from(args)?;
let gccrs_args = ArgsCollection::try_from(&rustc_args)?;

for arg_set in gccrs_args.iter() {
for arg_set in gccrs_args.data().iter() {
Gccrs::compile(arg_set)?;
Gccrs::maybe_callback(arg_set)?;
}
Expand Down