Remove fn main() from doctests
This commit is contained in:
parent
0992ac4fd7
commit
2911c38793
24
src/lib.rs
24
src/lib.rs
|
@ -34,19 +34,17 @@
|
|||
//! }
|
||||
//! }
|
||||
//!
|
||||
//! fn main() {
|
||||
//! let cert_store = rustls::RootCertStore::empty();
|
||||
//! let cert_store = rustls::RootCertStore::empty();
|
||||
//!
|
||||
//! let config = rustls::ClientConfig::builder()
|
||||
//! .with_root_certificates(cert_store)
|
||||
//! .with_no_client_auth();
|
||||
//! let config = rustls::ClientConfig::builder()
|
||||
//! .with_root_certificates(cert_store)
|
||||
//! .with_no_client_auth();
|
||||
//!
|
||||
//! let tls = MakeRustlsConnect::new(config, DemoDigest);
|
||||
//! let tls = MakeRustlsConnect::new(config, DemoDigest);
|
||||
//!
|
||||
//! let connect_future = tokio_postgres::connect("postgres://username:password@localhost:5432/db", tls);
|
||||
//! let connect_future = tokio_postgres::connect("postgres://username:password@localhost:5432/db", tls);
|
||||
//!
|
||||
//! // connect_future.await;
|
||||
//! }
|
||||
//! // connect_future.await;
|
||||
//! ```
|
||||
//!
|
||||
//! ## License
|
||||
|
@ -124,7 +122,6 @@ mod aws_lc_rs_backend {
|
|||
///
|
||||
/// Usage:
|
||||
/// ```rust
|
||||
/// # fn main() {
|
||||
/// # let cert_store = rustls::RootCertStore::empty();
|
||||
/// #
|
||||
/// # let rustls_config = rustls::ClientConfig::builder()
|
||||
|
@ -136,7 +133,6 @@ mod aws_lc_rs_backend {
|
|||
/// let tls = MakeRustlsConnect::new(rustls_config, AwsLcRsDigest);
|
||||
///
|
||||
/// let connect_future = tokio_postgres::connect("postgres://username:password@localhost:5432/db", tls);
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct AwsLcRsDigest;
|
||||
|
||||
|
@ -163,7 +159,6 @@ mod ring_backend {
|
|||
///
|
||||
/// Usage:
|
||||
/// ```rust
|
||||
/// # fn main() {
|
||||
/// # let cert_store = rustls::RootCertStore::empty();
|
||||
/// #
|
||||
/// # let rustls_config = rustls::ClientConfig::builder()
|
||||
|
@ -175,7 +170,6 @@ mod ring_backend {
|
|||
/// let tls = MakeRustlsConnect::new(rustls_config, RingDigest);
|
||||
///
|
||||
/// let connect_future = tokio_postgres::connect("postgres://username:password@localhost:5432/db", tls);
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct RingDigest;
|
||||
|
||||
|
@ -203,7 +197,6 @@ mod rustcrypto_backend {
|
|||
///
|
||||
/// Usage:
|
||||
/// ```rust
|
||||
/// # fn main() {
|
||||
/// # let cert_store = rustls::RootCertStore::empty();
|
||||
/// #
|
||||
/// # let rustls_config = rustls::ClientConfig::builder()
|
||||
|
@ -215,7 +208,6 @@ mod rustcrypto_backend {
|
|||
/// let tls = MakeRustlsConnect::new(rustls_config, RustcryptoDigest);
|
||||
///
|
||||
/// let connect_future = tokio_postgres::connect("postgres://username:password@localhost:5432/db", tls);
|
||||
/// # }
|
||||
pub struct RustcryptoDigest;
|
||||
|
||||
impl DigestImplementation for RustcryptoDigest {
|
||||
|
@ -249,7 +241,6 @@ mod rustcrypto_backend {
|
|||
/// # }
|
||||
/// # }
|
||||
/// #
|
||||
/// # fn main() {
|
||||
/// # let cert_store = rustls::RootCertStore::empty();
|
||||
/// #
|
||||
/// # let rustls_config = rustls::ClientConfig::builder()
|
||||
|
@ -261,7 +252,6 @@ mod rustcrypto_backend {
|
|||
/// let tls = MakeRustlsConnect::new(rustls_config, DemoDigest);
|
||||
///
|
||||
/// let connect_future = tokio_postgres::connect("postgres://username:password@localhost:5432/db", tls);
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct MakeRustlsConnect<D> {
|
||||
config: Arc<ClientConfig>,
|
||||
|
|
Loading…
Reference in a new issue