Skip to content

Commit

Permalink
Merge pull request #823 from lvillani/rust-highlight-where-keyword
Browse files Browse the repository at this point in the history
Rust: highlight the "where" keyword
  • Loading branch information
gfx authored Dec 21, 2017
2 parents b0fb90a + 7c9d4c2 commit a5da44d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/rouge/lexers/rust.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def self.keywords
@keywords ||= %w(
as assert break const copy do drop else enum extern fail false
fn for if impl let log loop match mod move mut priv pub pure
ref return self static struct true trait type unsafe use while
box
ref return self static struct true trait type unsafe use where
while box
)
end

Expand Down
5 changes: 4 additions & 1 deletion spec/visual/samples/rust
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ impl<A> &[A]: iterable<A> {
}
}

fn length<A, T: iterable<A>>(x: T) -> uint {
fn length<A, T>(x: T) -> uint
where
T: iterable<A>,
{
let mut len = 0;
for x.iterate() |_y| { len += 1 }
return len;
Expand Down

0 comments on commit a5da44d

Please sign in to comment.