File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ authors = ["Steven Fackler <sfackler@gmail.com>"]
5
5
license = " MIT"
6
6
description = " Array support for rust-postgres"
7
7
repository = " https://github.com/sfackler/rust-postgres-array"
8
- documentation = " https://sfackler.github.io/rust-postgres-array/doc/v0 .8.0/postgres_array"
8
+ documentation = " https://docs.rs/postgres_array/0 .8.0/postgres_array"
9
9
10
10
[dependencies ]
11
11
fallible-iterator = " 0.1"
Original file line number Diff line number Diff line change 1
1
//! Multi-dimensional arrays with per-dimension specifiable lower bounds
2
- #![ doc( html_root_url="https://sfackler.github.io/rust-postgres-array/doc/v0.7.1 " ) ]
2
+ #![ doc( html_root_url="https://docs.rs/postgres_array/0.8.0 " ) ]
3
3
4
4
extern crate fallible_iterator;
5
5
#[ macro_use]
@@ -25,8 +25,10 @@ impl Dimension {
25
25
fn shift ( & self , idx : i32 ) -> i32 {
26
26
let offset = self . lower_bound ;
27
27
assert ! ( idx >= offset, "out of bounds array access" ) ;
28
- assert ! ( offset >= 0 || idx <= 0 || i32 :: max_value( ) - ( -offset) >= idx,
29
- "out of bounds array access" ) ;
28
+ assert ! (
29
+ offset >= 0 || idx <= 0 || i32 :: max_value( ) - ( -offset) >= idx,
30
+ "out of bounds array access"
31
+ ) ;
30
32
match idx. checked_sub ( offset) {
31
33
Some ( shifted) => shifted,
32
34
None => panic ! ( "out of bounds array access" ) ,
@@ -41,10 +43,15 @@ mod tests {
41
43
#[ test]
42
44
fn test_from_vec ( ) {
43
45
let a = Array :: from_vec ( vec ! [ 0i32 , 1 , 2 ] , -1 ) ;
44
- assert ! ( & [ Dimension {
45
- len: 3 ,
46
- lower_bound: -1 ,
47
- } ] [ ..] == a. dimensions( ) ) ;
46
+ assert ! (
47
+ & [
48
+ Dimension {
49
+ len: 3 ,
50
+ lower_bound: -1 ,
51
+ } ,
52
+ ]
53
+ [ ..] == a. dimensions( )
54
+ ) ;
48
55
assert_eq ! ( 0 , a[ -1 ] ) ;
49
56
assert_eq ! ( 1 , a[ 0 ] ) ;
50
57
assert_eq ! ( 2 , a[ 1 ] ) ;
You can’t perform that action at this time.
0 commit comments