Check doc code blocks
This commit is contained in:
parent
a8cf28d428
commit
3760a98528
23
Makefile.in
23
Makefile.in
@ -4,23 +4,6 @@ export RUSTFLAGS := -O --cfg ndebug
|
||||
BUILDDIR := build
|
||||
INSTALL_DIR := %PREFIX%
|
||||
|
||||
###############################################################################
|
||||
# Reconfiguration
|
||||
###############################################################################
|
||||
CONFIGURE_ARGS := %CONFIGURE_ARGS%
|
||||
|
||||
NEED_GIT_RECONFIG := $(shell git submodule status | grep -c '^\(+|-\)')
|
||||
|
||||
ifeq ($(NEED_GIT_RECONFIG),0)
|
||||
else
|
||||
.PHONY: config.stamp
|
||||
endif
|
||||
|
||||
Makefile: config.stamp
|
||||
|
||||
config.stamp: configure Makefile.in
|
||||
./configure $(CONFIGURE_ARGS)
|
||||
|
||||
###############################################################################
|
||||
# Dependencies
|
||||
###############################################################################
|
||||
@ -71,8 +54,10 @@ all: $(POSTGRES_LIB)
|
||||
###############################################################################
|
||||
# Utility
|
||||
###############################################################################
|
||||
check-doc: $(POSTGRES_LIB)
|
||||
$(RUSTDOC) $(LINK_ARGS) -L $(BUILDDIR) --test $(POSTGRES_LIB_FILE)
|
||||
|
||||
check: $(POSTGRES_TEST)
|
||||
check: $(POSTGRES_TEST) check-doc
|
||||
$(POSTGRES_TEST)
|
||||
|
||||
clean:
|
||||
@ -90,4 +75,4 @@ install: $(POSTGRES_LIB)
|
||||
$(MAKE) -C $(PHF_DIR) install INSTALL_DIR=$(abspath $(INSTALL_DIR))
|
||||
install $(POSTGRES_LIB) $(INSTALL_DIR)
|
||||
|
||||
.PHONY: check clean doc install
|
||||
.PHONY: check-doc check clean clean-deps doc install
|
||||
|
@ -5,10 +5,9 @@ package.
|
||||
|
||||
```rust
|
||||
extern crate postgres;
|
||||
extern crate extra;
|
||||
extern crate time;
|
||||
|
||||
use extra::time;
|
||||
use extra::time::Timespec;
|
||||
use time::Timespec;
|
||||
|
||||
use postgres::{PostgresConnection, PostgresStatement, NoSsl};
|
||||
use postgres::types::ToSql;
|
||||
@ -20,6 +19,7 @@ struct Person {
|
||||
data: Option<~[u8]>
|
||||
}
|
||||
|
||||
# fn main() {
|
||||
fn main() {
|
||||
let conn = PostgresConnection::connect("postgres://postgres@localhost",
|
||||
&NoSsl);
|
||||
@ -52,6 +52,7 @@ fn main() {
|
||||
println!("Found person {}", person.name);
|
||||
}
|
||||
}
|
||||
# }
|
||||
```
|
||||
*/
|
||||
|
||||
@ -683,7 +684,7 @@ impl PostgresConnection {
|
||||
///
|
||||
/// The URL should be provided in the normal format:
|
||||
///
|
||||
/// ```
|
||||
/// ```notrust
|
||||
/// postgres://user[:password]@host[:port][/database][?param1=val1[[¶m2=val2]...]]
|
||||
/// ```
|
||||
///
|
||||
|
@ -472,8 +472,17 @@ impl<'stmt> Iterator<PostgresRow<'stmt>> for PostgresResult<'stmt> {
|
||||
/// by index is more efficient. Rows are 1-indexed.
|
||||
///
|
||||
/// ```rust
|
||||
/// # extern crate postgres;
|
||||
/// # use postgres::{PostgresConnection, PostgresStatement, NoSsl};
|
||||
/// # fn main() {}
|
||||
/// # fn foo() {
|
||||
/// # let conn = PostgresConnection::connect("", &NoSsl);
|
||||
/// # let stmt = conn.prepare("");
|
||||
/// # let mut result = stmt.query([]);
|
||||
/// # let row = result.next().unwrap();
|
||||
/// let foo: i32 = row[1];
|
||||
/// let bar: ~str = row["bar"];
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct PostgresRow<'stmt> {
|
||||
priv stmt: &'stmt NormalPostgresStatement<'stmt>,
|
||||
|
Loading…
Reference in New Issue
Block a user