Skip to content

Commit

Permalink
Fix up docs
Browse files Browse the repository at this point in the history
Resolve some issues discussed in pull #10.
  • Loading branch information
ntrel authored and medvednikov committed Mar 17, 2019
1 parent fdf0fbd commit ea7f8a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/templates/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ <h2 id=for>For loop</h2>
because with the latter it's easy to forget to update the counter and get
stuck in an infinite loop.

TODO: Break and continue.


<h2 id=switch>Switch</h2>
Expand Down Expand Up @@ -583,7 +582,8 @@ <h2 id=generics>Generics</h2>
}

<comment>// This is a generic receiver function. V will generate it for every Repo instance it's used with.
// T is a member type of Repo, so it is in scope for this receiver function.</comment>
// T is inferred by the receiver argument. Again &lt;T> is implied by just writing Repo:
// fn (r Repo&lt;T>) find_by_id&lt;T>(id int) T?</comment>
fn (r Repo) find_by_id(id int) T? {
table_name := T.name <comment>// in this example getting the name of the type gives us the table name</comment>
return db.query_one&lt;T>('select * from $table_name where id = ?', id)
Expand Down

0 comments on commit ea7f8a7

Please sign in to comment.