Fix doctest compilation errors in config.rs
- Fix doctest import paths to use calendar_backend::config::CalDAVConfig - Add proper Result handling in doctest example with ?operator - All doctests now passing (3/3) - Complete test coverage: 7 unit + 9 integration + 3 doc = 19 tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -16,13 +16,15 @@ use base64::prelude::*;
|
|||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use crate::config::CalDAVConfig;
|
/// # use calendar_backend::config::CalDAVConfig;
|
||||||
///
|
/// # fn example() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
/// // Load configuration from environment variables
|
/// // Load configuration from environment variables
|
||||||
/// let config = CalDAVConfig::from_env()?;
|
/// let config = CalDAVConfig::from_env()?;
|
||||||
///
|
///
|
||||||
/// // Use the configuration for HTTP requests
|
/// // Use the configuration for HTTP requests
|
||||||
/// let auth_header = format!("Basic {}", config.get_basic_auth());
|
/// let auth_header = format!("Basic {}", config.get_basic_auth());
|
||||||
|
/// # Ok(())
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct CalDAVConfig {
|
pub struct CalDAVConfig {
|
||||||
@@ -72,7 +74,7 @@ impl CalDAVConfig {
|
|||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use crate::config::CalDAVConfig;
|
/// # use calendar_backend::config::CalDAVConfig;
|
||||||
///
|
///
|
||||||
/// match CalDAVConfig::from_env() {
|
/// match CalDAVConfig::from_env() {
|
||||||
/// Ok(config) => {
|
/// Ok(config) => {
|
||||||
@@ -123,7 +125,7 @@ impl CalDAVConfig {
|
|||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use crate::config::CalDAVConfig;
|
/// # use calendar_backend::config::CalDAVConfig;
|
||||||
///
|
///
|
||||||
/// let config = CalDAVConfig {
|
/// let config = CalDAVConfig {
|
||||||
/// server_url: "https://example.com".to_string(),
|
/// server_url: "https://example.com".to_string(),
|
||||||
|
|||||||
Reference in New Issue
Block a user