Skip to content

Commit b926745

Browse files
committed
More StrBuf cleanup
1 parent fec7286 commit b926745

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn main() {
4545
};
4646
conn.execute("INSERT INTO person (name, time_created, data)
4747
VALUES ($1, $2, $3)",
48-
[&me.name.as_slice() as &ToSql, &me.time_created as &ToSql,
48+
[&me.name as &ToSql, &me.time_created as &ToSql,
4949
&me.data as &ToSql]).unwrap();
5050

5151
let stmt = conn.prepare("SELECT id, name, time_created, data FROM person")
@@ -66,7 +66,7 @@ Requirements
6666
============
6767

6868
* **Rust** - Rust-Postgres is developed against the *master* branch of the Rust
69-
repository. It will most likely not build against the releases on
69+
repository. It will most likely not build against the versioned releases on
7070
http://www.rust-lang.org.
7171

7272
* **PostgreSQL 7.4 or later** - Rust-Postgres speaks version 3 of the
@@ -123,7 +123,7 @@ columns are one-indexed.
123123
let stmt = try!(conn.prepare("SELECT bar, baz FROM foo"));
124124
for row in try!(stmt.query([])) {
125125
let bar: i32 = row[1];
126-
let baz: StrBuf = row["baz"];
126+
let baz: String = row["baz"];
127127
println!("bar: {}, baz: {}", bar, baz);
128128
}
129129
```
@@ -220,7 +220,7 @@ types. The driver currently supports the following conversions:
220220
<td>DOUBLE PRECISION</td>
221221
</tr>
222222
<tr>
223-
<td>str/StrBuf</td>
223+
<td>str/String</td>
224224
<td>VARCHAR, CHAR(n), TEXT</td>
225225
</tr>
226226
<tr>
@@ -272,7 +272,7 @@ types. The driver currently supports the following conversions:
272272
<td>INT4[], INT4[][], ...</td>
273273
</tr>
274274
<tr>
275-
<td>types::array::ArrayBase&lt;Option&lt;StrBuf&gt;&gt;</td>
275+
<td>types::array::ArrayBase&lt;Option&lt;String&gt;&gt;</td>
276276
<td>TEXT[], CHAR(n)[], VARCHAR[], TEXT[][], ...</td>
277277
</tr>
278278
<tr>
@@ -312,7 +312,7 @@ types. The driver currently supports the following conversions:
312312
<td>INT8RANGE[], INT8RANGE[][], ...</td>
313313
</tr>
314314
<tr>
315-
<td>std::hashmap::HashMap&lt;StrBuf, Option&lt;StrBuf&gt;&gt;</td>
315+
<td>std::hashmap::HashMap&lt;String, Option&lt;String&gt;&gt;</td>
316316
<td>HSTORE</td>
317317
</tr>
318318
</tbody>

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn main() {
3737
};
3838
conn.execute("INSERT INTO person (name, time_created, data)
3939
VALUES ($1, $2, $3)",
40-
[&me.name.as_slice() as &ToSql, &me.time_created as &ToSql,
40+
[&me.name as &ToSql, &me.time_created as &ToSql,
4141
&me.data as &ToSql]).unwrap();
4242
4343
let stmt = conn.prepare("SELECT id, name, time_created, data FROM person")
@@ -1449,10 +1449,10 @@ impl RowIndex for int {
14491449
#[inline]
14501450
fn idx(&self, stmt: &PostgresStatement) -> Option<uint> {
14511451
if *self < 0 {
1452-
return None;
1452+
None
1453+
} else {
1454+
(*self as uint).idx(stmt)
14531455
}
1454-
1455-
(*self as uint).idx(stmt)
14561456
}
14571457
}
14581458

0 commit comments

Comments
 (0)