Skip to content

Commit

Permalink
Remove different behaviour when single input
Browse files Browse the repository at this point in the history
  • Loading branch information
olorin37 committed Apr 30, 2024
1 parent c09b4ca commit 0d4b06f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion cli/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ impl<C: clap::Args + Customize> Prepare for InputOptions<C> {
fn prepare(&self, global: &GlobalOptions) -> CliResult<Program<CBNCache>> {
let mut program = match self.files.as_slice() {
[] => Program::new_from_stdin(std::io::stderr()),
[p] => Program::new_from_file(p, std::io::stderr()),
files => Program::new_from_files(files, std::io::stderr()),
}?;

Expand Down
18 changes: 0 additions & 18 deletions core/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,24 +230,6 @@ impl<EC: EvalCache> Program<EC> {
})
}

pub fn new_from_file(
path: impl Into<OsString>,
trace: impl Write + 'static,
) -> std::io::Result<Self> {
increment!("Program::new");

let mut cache = Cache::new(ErrorTolerance::Strict);
let main_id = cache.add_file(path)?;
let vm = VirtualMachine::new(cache, trace);
Ok(Self {
main_id,
vm,
color_opt: clap::ColorChoice::Auto.into(),
overrides: Vec::new(),
field: FieldPath::new(),
})
}

/// Create a program by reading it from a generic source.
pub fn new_from_source<T, S>(
source: T,
Expand Down

0 comments on commit 0d4b06f

Please sign in to comment.