Avoid unnecessary String
This commit is contained in:
parent
81323cafd4
commit
d3f9430a18
@ -80,7 +80,7 @@ impl Schala {
|
|||||||
let prelude = include_str!("prelude.schala");
|
let prelude = include_str!("prelude.schala");
|
||||||
let mut s = Schala::new_blank_env();
|
let mut s = Schala::new_blank_env();
|
||||||
|
|
||||||
let request = ComputationRequest { source: prelude.to_string(), debug_requests: vec![] };
|
let request = ComputationRequest { source: prelude, debug_requests: vec![] };
|
||||||
s.run_computation(request);
|
s.run_computation(request);
|
||||||
s
|
s
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,8 @@ pub trait ProgrammingLanguageInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO source can probably be a &str
|
pub struct ComputationRequest<'a> {
|
||||||
pub struct ComputationRequest {
|
pub source: &'a str,
|
||||||
pub source: String,
|
|
||||||
pub debug_requests: Vec<DebugRequest>,
|
pub debug_requests: Vec<DebugRequest>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ impl Repl {
|
|||||||
let ref mut language_state = self.get_cur_language_state();
|
let ref mut language_state = self.get_cur_language_state();
|
||||||
|
|
||||||
let request = ComputationRequest {
|
let request = ComputationRequest {
|
||||||
source: input.to_string(),
|
source: input,
|
||||||
debug_requests: vec![],
|
debug_requests: vec![],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user