mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
http: refactor and reduce duplication
This commit is contained in:

committed by
Alexander Medvednikov

parent
756c6d2858
commit
84a6c019e8
@ -1,7 +1,7 @@
|
||||
import net.http
|
||||
|
||||
fn main() {
|
||||
html := http.get_text('https://news.ycombinator.com')
|
||||
html := http.get_text('https://news.ycombinator.com')
|
||||
mut pos := 0
|
||||
for {
|
||||
pos = html.index_after('https://', pos + 1)
|
||||
@ -12,4 +12,3 @@ fn main() {
|
||||
println(html[pos..end])
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user