Skip to content

Commit

Permalink
[parameters] Update parameters API inline with latest transcript rela…
Browse files Browse the repository at this point in the history
…ted changes [#65]
  • Loading branch information
cipriancraciun committed May 11, 2018
1 parent 873b245 commit f9bb374
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sources/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2249,7 +2249,7 @@ impl <'a> EvaluatorContext<'a> {
let parameters = if let Some (ref parameters) = self.parameters {
try! (parameters.fork ())
} else {
Parameters::new_empty ()
try! (Parameters::new_empty ())
};
succeed! (self.fork_with_parameters (parameters));
}
Expand Down
8 changes: 4 additions & 4 deletions sources/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Parameters {


#[ cfg_attr ( feature = "vonuvoli_inline", inline ) ]
pub fn new_empty () -> (Parameters) {
pub fn new_empty () -> (Outcome<Parameters>) {
let internals = ParametersInternals {
bindings : StdMap::new (),
#[ cfg ( feature = "vonuvoli_builtins_ports" ) ]
Expand All @@ -63,12 +63,12 @@ impl Parameters {
process_arguments : None,
process_environment : None,
#[ cfg ( feature = "vonuvoli_builtins_transcript" ) ]
transcript : transcript_for_script (),
transcript : try! (transcript_for_script ()),
parent : None,
immutable : false,
handle : parameters_handles_next (),
};
return Parameters (StdRc::new (StdRefCell::new (internals)));
succeed! (Parameters (StdRc::new (StdRefCell::new (internals))));
}

#[ cfg_attr ( feature = "vonuvoli_inline", inline ) ]
Expand All @@ -88,7 +88,7 @@ impl Parameters {
process_arguments : Some (StdRc::new (vec_map_into! (process_arguments, value, value.into_boxed_os_str ()) .into_boxed_slice ())),
process_environment : Some (StdRc::new (vec_map_into! (process_environment, (name, value), (name.into_boxed_os_str (), value.into_boxed_os_str ())) .into_boxed_slice ())),
#[ cfg ( feature = "vonuvoli_builtins_transcript" ) ]
transcript : transcript_for_script (),
transcript : try! (transcript_for_script ()),
parent : None,
immutable : false,
handle : parameters_handles_next (),
Expand Down
8 changes: 4 additions & 4 deletions sources/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ pub fn compile_tests (identifier : &str, tests : &StdVec<TestCase>, context_temp
let (context_without_optimizations, context_with_optimizations) = (context_template.fork (), context_template.fork ());

#[ cfg ( feature = "vonuvoli_builtins_parameters" ) ]
let parameters_without_optimization = Some (Parameters::new_empty ());
let parameters_without_optimization = Some (try! (Parameters::new_empty ()));
#[ cfg ( feature = "vonuvoli_builtins_parameters" ) ]
let parameters_with_optimization = Some (Parameters::new_empty ());
let parameters_with_optimization = Some (try! (Parameters::new_empty ()));

#[ cfg ( not ( feature = "vonuvoli_builtins_parameters" ) ) ]
let parameters_without_optimization = None;
Expand Down Expand Up @@ -212,7 +212,7 @@ pub fn benchmark_tests (identifier : &str, tests : &StdVec<TestCaseCompiled>, be
try! (benchmark_bencher_iterate (bencher, iterations_without_optimizations,
|| {
#[ cfg ( feature = "vonuvoli_builtins_parameters" ) ]
let parameters = Some (Parameters::new_empty ());
let parameters = Some (Parameters::new_empty () .expect ("5c37298f"));
#[ cfg ( not ( feature = "vonuvoli_builtins_parameters" ) ) ]
let parameters = None;
let evaluator = Evaluator::new ();
Expand All @@ -226,7 +226,7 @@ pub fn benchmark_tests (identifier : &str, tests : &StdVec<TestCaseCompiled>, be
try! (benchmark_bencher_iterate (bencher, iterations_with_optimizations,
|| {
#[ cfg ( feature = "vonuvoli_builtins_parameters" ) ]
let parameters = Some (Parameters::new_empty ());
let parameters = Some (Parameters::new_empty () .expect ("5326fbea"));
#[ cfg ( not ( feature = "vonuvoli_builtins_parameters" ) ) ]
let parameters = None;
let evaluator = Evaluator::new ();
Expand Down

0 comments on commit f9bb374

Please sign in to comment.