Skip to content

Commit

Permalink
Cleaned up useless Result
Browse files Browse the repository at this point in the history
  • Loading branch information
anti-social committed Mar 18, 2020
1 parent d1b7b46 commit 0c0e030
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::{env, path::PathBuf};

use crate::Target;
use crate::cargo::Subcommand;
use crate::errors::Result;
use crate::rustc::TargetList;

#[derive(Debug)]
Expand All @@ -14,7 +13,7 @@ pub struct Args {
pub target_dir: Option<PathBuf>,
}

pub fn parse(target_list: &TargetList) -> Result<Args> {
pub fn parse(target_list: &TargetList) -> Args {
let mut channel = None;
let mut target = None;
let mut target_dir = None;
Expand Down Expand Up @@ -56,11 +55,11 @@ pub fn parse(target_list: &TargetList) -> Result<Args> {
}
}

Ok(Args {
Args {
all,
subcommand: sc,
channel,
target,
target_dir,
})
}
}
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pub fn main() {

fn run() -> Result<ExitStatus> {
let target_list = rustc::target_list(false)?;
let args = cli::parse(&target_list)?;
let args = cli::parse(&target_list);

if args.all.iter().any(|a| a == "--version" || a == "-V") &&
args.subcommand.is_none() {
Expand Down

0 comments on commit 0c0e030

Please sign in to comment.