docs: fix remaining `mut`s

pull/4433/head
axinli 2020-04-16 11:52:35 +08:00 committed by GitHub
parent e1a2a4f362
commit 5e4c5f189f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -322,7 +322,7 @@ println(upper) // ['HELLO', 'WORLD']
## Maps ## Maps
```v ```v
mut m := map[string]int // Only maps with string keys are allowed for now var m := map[string]int // Only maps with string keys are allowed for now
m['one'] = 1 m['one'] = 1
m['two'] = 2 m['two'] = 2
println(m['one']) // "1" println(m['one']) // "1"
@ -557,7 +557,7 @@ button.widget.set_pos(x,y)
Struct fields are private and immutable by default (making structs immutable as well). Struct fields are private and immutable by default (making structs immutable as well).
Their access modifiers can be changed with Their access modifiers can be changed with
`pub` and `mut`. In total, there are 5 possible options: `pub` and `var`. In total, there are 5 possible options:
```v ```v
struct Foo { struct Foo {
@ -588,7 +588,6 @@ pub:
It's easy to see from this definition that `string` is an immutable type. It's easy to see from this definition that `string` is an immutable type.
The byte pointer with the string data is not accessible outside `builtin` at all. The byte pointer with the string data is not accessible outside `builtin` at all.
`len` field is public, but not mutable: `len` field is public, but not mutable:
```v ```v
fn main() { fn main() {
str := 'hello' str := 'hello'
@ -634,7 +633,7 @@ This is achieved by lack of global variables and all function arguments being im
even when references are passed. even when references are passed.
V is not a pure functional language however. V is not a pure functional language however.
It is possible to modify function arguments by using the same keyword `mut`: It is possible to modify function arguments by using the same keyword `var`:
```v ```v
struct User { struct User {