1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: remove return vweb.Result{} everywhere

This commit is contained in:
Alexander Medvednikov
2021-01-08 04:57:02 +01:00
parent e3f8d448c1
commit 352cf91ba2
4 changed files with 14 additions and 24 deletions

View File

@@ -5,29 +5,26 @@ struct App {
}
pub fn (mut app App) no_attributes(a string) vweb.Result {
return vweb.Result{}
return app.text('ok')
}
// works fine, as long as fcn gets 1 arg and route takes 1 var
['/foo/:bar']
pub fn (mut app App) foo(a string) vweb.Result {
eprintln('foo')
app.html('works')
return vweb.Result{}
return app.html('works')
}
// segfault because path taks 0 vars and fcn takes 1 arg
['/bar']
pub fn (mut app App) bar(a string) vweb.Result {
app.html('works')
return vweb.Result{}
return app.html('works')
}
// no segfault, but it shouldnt compile
['/cow/:low']
pub fn (mut app App) cow() vweb.Result {
app.html('works')
return vweb.Result{}
return app.html('works')
}
pub fn (app App) init_once() {