Skip to content

Commit 706b0cc

Browse files
committed
fix: doctest
1 parent 8150f05 commit 706b0cc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ homepage = "https://github.com/init4tech/bin-base"
1313
repository = "https://github.com/init4tech/bin-base"
1414

1515
[dependencies]
16-
init4-from-env-derive = { path = "./from-env-derive" }
16+
init4-from-env-derive = "0.1.0"
1717

1818
# Tracing
1919
tracing = "0.1.40"

src/utils/from_env.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,17 @@ pub trait FromEnv: core::fmt::Debug + Sized + 'static {
304304
/// impl.
305305
///
306306
/// ```
307-
/// # use init4_bin_base::utils::from_env::FromEnvVar;
307+
/// # use init4_bin_base::utils::from_env::{FromEnvVar, FromEnvErr};
308+
/// # use std::str::FromStr;
309+
/// # #[derive(Debug)]
308310
/// # pub struct MyCoolType;
309311
/// # impl std::str::FromStr for MyCoolType {
310-
/// # type Err;
312+
/// # type Err = std::convert::Infallible;
311313
/// # fn from_str(s: &str) -> Result<Self, Self::Err> {
312314
/// # Ok(MyCoolType)
313315
/// # }
314316
/// # }
317+
///
315318
/// // We can re-use the `FromStr` implementation for our `FromEnvVar` impl.
316319
/// impl FromEnvVar for MyCoolType {
317320
/// type Error = <MyCoolType as FromStr>::Err;

0 commit comments

Comments
 (0)