diff options
author | Joe Wilm <joe@jwilm.com> | 2016-07-03 17:00:00 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-07-03 17:00:00 -0700 |
commit | 7f1c1efe474851a129e4a2e5bc012d9b76ed2ed0 (patch) | |
tree | 4fc278de8e08f16ff80d976c60c454a29e452e7f /src/main.rs | |
parent | bc2793a762b505d2d3c7af65e878f864a36cb19b (diff) | |
download | alacritty-7f1c1efe474851a129e4a2e5bc012d9b76ed2ed0.tar.gz alacritty-7f1c1efe474851a129e4a2e5bc012d9b76ed2ed0.zip |
Grid API is now generic and strongly typed
The Grid no longer knows about a `Cell` and is instead generic. The
`Cell` type is coupled to the `term` module already, and it's been moved
there to reflect the strong relationship.
Grid APIs previously accepted `usize` for many arguments. If the caller
intended rows to be columns, but the function accepted them in reverse,
there would be no compiler error. Now there is, and this should prevent
such bugs from entering the code.
The Grid internals grew significantly to accomodate the strongly typed
APIs. There is now a `grid::index` module which defines Cursor, Line,
and Column. The Grid APIs are all based on these types now. Indexing for
Ranges proved to be somewhat awkward. A new range had to be constructed
in the implementation. If the optimizer can't figure out what's going on
in that case, the ranges may not be a zero-cost abstraction.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index aae02322..e73ec15c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,6 +18,8 @@ #![feature(inclusive_range_syntax)] #![feature(drop_types_in_const)] #![feature(unicode)] +#![feature(zero_one)] +#![feature(step_trait)] #![feature(custom_derive, plugin)] #![plugin(serde_macros)] |