Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Refactor terminal representation again #45

Merged
merged 12 commits into from
Nov 8, 2018

Conversation

swsnr
Copy link
Owner

@swsnr swsnr commented Nov 8, 2018

Replace Terminal and dynamic dispatch with TerminalCapabilities and static dispatch. Also allows for less complicated and more accurate conditional compilation.

Remove Terminal trait in favour of a TerminalCapabilities struct, and
explicitly pattern match over supported capabilities while rendering.

This removes boxing and dynamic dispatch, and makes different features
and internal behaviour like HTTP access more explicit.  We now also
explicitly check what and how certain features are supported while
rendering; this gets rids of the NotSupportedError thing and the kludge
to handle it in a special way which I never quite liked.

Also simply how we check for access to resources:  Remove the resource
enum and instead use Url directly.  Via the scheme an URL already tells
us whether it’s local or not, so we just rely on the scheme and file
path conversion now.  This makes resolving references in markdown files
and checking access much simpler.
Fix compiler warnings with --no-default-features by removing unused code.
Use empty bindings instead of drop to mark
variables as used
Only iterm2 actually uses it.

Fixes unused warning when compiling only with terminology.
[ci skip]
@swsnr swsnr merged commit 3f40829 into master Nov 8, 2018
@swsnr swsnr deleted the refactor-terminal-representation-again branch November 8, 2018 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant