Replace Fillable interface with a concrete wrapper

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes
2021-01-21 16:49:25 -08:00
parent 2ee27e83f3
commit eab6028b70
6 changed files with 35 additions and 29 deletions

View File

@@ -52,7 +52,7 @@ func (c *Component) ComputeScript() (*Script, error) {
// 1. Always start with an empty fs state (Execute may receive any state as input)
// 2. Always solve at the end (Execute is lazy)
//
func (c *Component) Compute(ctx context.Context, s Solver, out Fillable) (FS, error) {
func (c *Component) Compute(ctx context.Context, s Solver, out *Fillable) (FS, error) {
fs, err := c.Execute(ctx, s.Scratch(), out)
if err != nil {
return fs, err
@@ -67,7 +67,7 @@ func (c *Component) Compute(ctx context.Context, s Solver, out Fillable) (FS, er
// A component implements the Executable interface by returning its
// compute script.
// See Value.Executable().
func (c *Component) Execute(ctx context.Context, fs FS, out Fillable) (FS, error) {
func (c *Component) Execute(ctx context.Context, fs FS, out *Fillable) (FS, error) {
script, err := c.ComputeScript()
if err != nil {
// If the component has no script, then do not fail.