Compare commits
4 Commits
8851e56a8b
...
v0.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 16906257ac | |||
| d91e53b7b1 | |||
| a815937d43 | |||
| 5c0d45f3e5 |
@@ -21,7 +21,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
v doc -f html -m .
|
v doc -f html -m .
|
||||||
pushd _docs
|
pushd _docs
|
||||||
ln -vs netaddr.html index.html
|
ln -vs ${{ github.event.repository.name }}.html index.html
|
||||||
ls -alFh
|
ls -alFh
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ fn sub_128(a [16]u8, b [16]u8) [16]u8 {
|
|||||||
mut borrowed := u8(0)
|
mut borrowed := u8(0)
|
||||||
for i := 15; i >= 0; i-- {
|
for i := 15; i >= 0; i-- {
|
||||||
if a[i] < b[i] {
|
if a[i] < b[i] {
|
||||||
res[i] = (a[i] + 256) - borrowed - b[i]
|
res[i] = u8((a[i] + 256) - borrowed - b[i])
|
||||||
borrowed = 1
|
borrowed = 1
|
||||||
} else {
|
} else {
|
||||||
res[i] = a[i] - borrowed - b[i]
|
res[i] = a[i] - borrowed - b[i]
|
||||||
|
|||||||
@@ -196,8 +196,7 @@ if available. For example (V REPL session):
|
|||||||
fe80::d08e:6658:38bd:6391%wlan0
|
fe80::d08e:6658:38bd:6391%wlan0
|
||||||
>>> ip6_scoped.zone_id
|
>>> ip6_scoped.zone_id
|
||||||
Option('wlan0')
|
Option('wlan0')
|
||||||
>>> zone_id := ip6_scoped.zone_id as string
|
>>> ip6_scoped.zone_id?
|
||||||
>>> zone_id
|
|
||||||
wlan0
|
wlan0
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -234,8 +234,9 @@ pub fn (a Ipv6Addr) format(fmt Ipv6AddrFormat) string {
|
|||||||
}
|
}
|
||||||
if a.zone_id == none {
|
if a.zone_id == none {
|
||||||
return str.join(':')
|
return str.join(':')
|
||||||
|
} else {
|
||||||
|
return str.join(':') + '%' + a.zone_id
|
||||||
}
|
}
|
||||||
return str.join(':') + '%' + (a.zone_id as string)
|
|
||||||
}
|
}
|
||||||
fmt & .verbose == .verbose {
|
fmt & .verbose == .verbose {
|
||||||
if fmt & .dotted == .dotted {
|
if fmt & .dotted == .dotted {
|
||||||
@@ -253,8 +254,9 @@ pub fn (a Ipv6Addr) format(fmt Ipv6AddrFormat) string {
|
|||||||
}
|
}
|
||||||
if a.zone_id == none {
|
if a.zone_id == none {
|
||||||
return str.join(':')
|
return str.join(':')
|
||||||
|
} else {
|
||||||
|
return str.join(':') + '%' + a.zone_id
|
||||||
}
|
}
|
||||||
return str.join(':') + '%' + (a.zone_id as string)
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return a.str()
|
return a.str()
|
||||||
@@ -459,8 +461,7 @@ pub:
|
|||||||
|
|
||||||
fn (p Ipv6AddrParams) validate() ! {
|
fn (p Ipv6AddrParams) validate() ! {
|
||||||
if p.zone_id != none {
|
if p.zone_id != none {
|
||||||
zone_id := p.zone_id as string
|
if p.zone_id.is_blank() || p.zone_id.contains('%') {
|
||||||
if zone_id.is_blank() || zone_id.contains('%') {
|
|
||||||
return error('zone_id cannot be blank or contain % sign')
|
return error('zone_id cannot be blank or contain % sign')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Module {
|
Module {
|
||||||
name: 'netaddr'
|
name: 'netaddr'
|
||||||
description: 'Network address processing library for V'
|
description: 'Network address processing library for V'
|
||||||
version: '0.1.0'
|
version: '0.1.1'
|
||||||
license: 'LGPL-3.0-or-later'
|
license: 'LGPL-3.0-or-later'
|
||||||
dependencies: []
|
dependencies: []
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user