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>"]
55license = " MIT"
66description = " Array support for rust-postgres"
77repository = " 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"
99
1010[dependencies ]
1111fallible-iterator = " 0.1"
Original file line number Diff line number Diff line change 11//! 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 " ) ]
33
44extern crate fallible_iterator;
55#[ macro_use]
@@ -25,8 +25,10 @@ impl Dimension {
2525 fn shift ( & self , idx : i32 ) -> i32 {
2626 let offset = self . lower_bound ;
2727 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+ ) ;
3032 match idx. checked_sub ( offset) {
3133 Some ( shifted) => shifted,
3234 None => panic ! ( "out of bounds array access" ) ,
@@ -41,10 +43,15 @@ mod tests {
4143 #[ test]
4244 fn test_from_vec ( ) {
4345 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+ ) ;
4855 assert_eq ! ( 0 , a[ -1 ] ) ;
4956 assert_eq ! ( 1 , a[ 0 ] ) ;
5057 assert_eq ! ( 2 , a[ 1 ] ) ;
You can’t perform that action at this time.
0 commit comments