Skip to content

Commit bba1f87

Browse files
committed
Documentation fixes
1 parent f484d8d commit bba1f87

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/postgres/lib.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub trait PostgresNoticeHandler {
124124
fn handle(&mut self, notice: PostgresDbError);
125125
}
126126

127-
/// A struct which handles notices by logging at the info level.
127+
/// A notice handler which logs at the `info` level.
128128
///
129129
/// This is the default handler used by a `PostgresConnection`.
130130
pub struct DefaultNoticeHandler;
@@ -713,7 +713,7 @@ pub trait PostgresStatement {
713713
/// the parameters of the statement.
714714
fn try_update(&self, params: &[&ToSql]) -> Result<uint, PostgresDbError>;
715715

716-
/// A conveience function wrapping `try_update`.
716+
/// A convenience function wrapping `try_update`.
717717
///
718718
/// Fails if there was an error executing the statement.
719719
fn update(&self, params: &[&ToSql]) -> uint;
@@ -1069,12 +1069,21 @@ impl<'self> Iterator<PostgresRow<'self>> for PostgresResult<'self> {
10691069
}
10701070

10711071
/// A single result row of a query.
1072+
///
1073+
/// A value can be accessed by the name or index of its column, though access
1074+
/// by index is more efficient.
1075+
///
1076+
/// ```rust
1077+
/// let foo: i32 = row[0];
1078+
/// let bar: ~str = row["bar"];
1079+
/// ```
10721080
pub struct PostgresRow<'self> {
10731081
priv stmt: &'self NormalPostgresStatement<'self>,
10741082
priv data: ~[Option<~[u8]>]
10751083
}
10761084

10771085
impl<'self> Container for PostgresRow<'self> {
1086+
#[inline]
10781087
fn len(&self) -> uint {
10791088
self.data.len()
10801089
}

src/postgres/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ macro_rules! check_types(
119119
)
120120
)
121121

122-
/// A trait for things that can be created from a Postgres value
122+
/// A trait for types that can be created from a Postgres value
123123
pub trait FromSql {
124124
/// Creates a new value of this type from a buffer of Postgres data.
125125
///

0 commit comments

Comments
 (0)