Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Render to Writer #187

Closed
epage opened this issue Sep 3, 2018 · 2 comments
Closed

Render to Writer #187

epage opened this issue Sep 3, 2018 · 2 comments
Labels
api-break enhancement Improve the expected

Comments

@epage
Copy link
Member

epage commented Sep 3, 2018

From @emoon

Also the ability to to do Template::render_to<W: Write>(&mut dest: W, ...) would be useful as well as now I always have to copy the resulting data to my destination (while Template would have been able to write to it directly, removing the copy and memory allocation)

@epage epage added enhancement Improve the expected api-break labels Sep 3, 2018
@epage
Copy link
Member Author

epage commented Sep 3, 2018

I see no reason not to do this. Seems reasonable.

epage added a commit to epage/liquid-rust that referenced this issue Sep 5, 2018
This is hopefully better than string concatenation, especially if you
can write directly to file.

Fixes cobalt-org#187

BREAKING CHANGE: `parser.render` now takes an `std::io::Write` rather
than return a `String`.
@epage
Copy link
Member Author

epage commented Sep 5, 2018

Started on an implementation in #192 but its a lot of tests to fix.

epage added a commit to epage/liquid-rust that referenced this issue Sep 5, 2018
`render_to` uses an `io::Write`.  This is hopefully better than string
concatenation, especially if you can write directly to file. `render` is
still available for convinience (though it no longer returns an
`Option`).

Fixes cobalt-org#187

BREAKING CHANGES: Changed focus to `io::Write`
- `Renderable`s must implement `render_to`.
- `render` no longer returns an `Option`.
epage added a commit to epage/liquid-rust that referenced this issue Sep 5, 2018
`render_to` uses an `io::Write`.  This is hopefully better than string
concatenation, especially if you can write directly to file. `render` is
still available for convinience (though it no longer returns an
`Option`).

Fixes cobalt-org#187

BREAKING CHANGES: Changed focus to `io::Write`
- `Renderable`s must implement `render_to`.
- `render` no longer returns an `Option`.
epage added a commit to epage/liquid-rust that referenced this issue Sep 5, 2018
`render_to` uses an `io::Write`.  This is hopefully better than string
concatenation, especially if you can write directly to file. `render` is
still available for convinience (though it no longer returns an
`Option`).

Fixes cobalt-org#187

BREAKING CHANGES: Changed focus to `io::Write`
- `Renderable`s must implement `render_to`.
- `render` no longer returns an `Option`.
@epage epage closed this as completed in #192 Sep 6, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
api-break enhancement Improve the expected
Projects
None yet
Development

No branches or pull requests

1 participant