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
|
||||
///
|
||||
/// ```rust
|
||||
/// use crate::config::CalDAVConfig;
|
||||
///
|
||||
/// # use calendar_backend::config::CalDAVConfig;
|
||||
/// # fn example() -> Result<(), Box<dyn std::error::Error>> {
|
||||
/// // Load configuration from environment variables
|
||||
/// let config = CalDAVConfig::from_env()?;
|
||||
///
|
||||
/// // Use the configuration for HTTP requests
|
||||
/// let auth_header = format!("Basic {}", config.get_basic_auth());
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct CalDAVConfig {
|
||||
@@ -72,7 +74,7 @@ impl CalDAVConfig {
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use crate::config::CalDAVConfig;
|
||||
/// # use calendar_backend::config::CalDAVConfig;
|
||||
///
|
||||
/// match CalDAVConfig::from_env() {
|
||||
/// Ok(config) => {
|
||||
@@ -123,7 +125,7 @@ impl CalDAVConfig {
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use crate::config::CalDAVConfig;
|
||||
/// # use calendar_backend::config::CalDAVConfig;
|
||||
///
|
||||
/// let config = CalDAVConfig {
|
||||
/// server_url: "https://example.com".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user