Simplify some struct definitions
This commit is contained in:
parent
a63dcf91b0
commit
ede8a9076a
@ -24,14 +24,14 @@ pub struct Repl {
|
|||||||
impl Repl {
|
impl Repl {
|
||||||
pub fn new(languages: Vec<Box<ProgrammingLanguageInterface>>, initial_index: usize) -> Repl {
|
pub fn new(languages: Vec<Box<ProgrammingLanguageInterface>>, initial_index: usize) -> Repl {
|
||||||
use linefeed::Interface;
|
use linefeed::Interface;
|
||||||
let i = if initial_index < languages.len() { initial_index } else { 0 };
|
let current_language_index = if initial_index < languages.len() { initial_index } else { 0 };
|
||||||
|
|
||||||
let line_reader = Interface::new("schala-repl").unwrap();
|
let line_reader = Interface::new("schala-repl").unwrap();
|
||||||
|
|
||||||
Repl {
|
Repl {
|
||||||
options: Repl::get_options(),
|
options: Repl::get_options(),
|
||||||
languages: languages,
|
languages,
|
||||||
current_language_index: i,
|
current_language_index,
|
||||||
interpreter_directive_sigil: ':',
|
interpreter_directive_sigil: ':',
|
||||||
line_reader
|
line_reader
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user