mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
fix(core): show argument index as starting from 0
This commit is contained in:
parent
4c1d2fa679
commit
635bb3e8f1
@ -75,7 +75,7 @@ impl<'a, Db: Database> Arguments<'a, Db> {
|
||||
/// and you attempt to bind a `&str` in Rust, an incompatible type error will be raised.
|
||||
///
|
||||
pub fn add<T: 'a + TypeEncode<Db>>(&mut self, value: &'a T) {
|
||||
let index = self.positional.len() + 1;
|
||||
let index = self.positional.len();
|
||||
|
||||
self.positional.push(Argument::new(Either::Left(index), value, false));
|
||||
}
|
||||
@ -87,7 +87,7 @@ impl<'a, Db: Database> Arguments<'a, Db> {
|
||||
/// will not be hinted when preparing the statement.
|
||||
///
|
||||
pub fn add_unchecked<T: 'a + TypeEncode<Db>>(&mut self, value: &'a T) {
|
||||
let index = self.positional.len() + 1;
|
||||
let index = self.positional.len();
|
||||
|
||||
self.positional.push(Argument::new(Either::Left(index), value, true));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user