mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
vlib: refactor empty string checks to use s == ''
or s != ''
, instead of s.len == 0
(#21300)
This commit is contained in:
parent
46be635072
commit
8aa9314a99
55 changed files with 95 additions and 96 deletions
|
@ -50,7 +50,7 @@ pub fn (app &App) create_todo(mut ctx Context, name string) vweb.Result {
|
|||
// we could also access the name field by doing `name := ctx.form['name']`
|
||||
|
||||
// validate input field
|
||||
if name.len == 0 {
|
||||
if name == '' {
|
||||
// set a form error
|
||||
ctx.form_error = 'You must fill in all the fields!'
|
||||
// send a HTTP 400 response code indicating that the form fields are incorrect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue