Skip to content

Commit 3df8952

Browse files
committed
Remove doctest that accesses private field
The doctest was trying to directly construct DiagnosticsConfig with the now-private severity field. Remove it since we have comprehensive unit tests covering the same functionality. Doctests are better for simple usage examples rather than testing internal implementation details.
1 parent f94ab56 commit 3df8952

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

crates/djls-conf/src/diagnostics.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,6 @@ impl DiagnosticsConfig {
4848
/// 1. Exact match (e.g., "S100")
4949
/// 2. Longest prefix match (e.g., "S1" over "S")
5050
/// 3. Default: Error
51-
///
52-
/// # Examples
53-
/// ```
54-
/// # use djls_conf::diagnostics::{DiagnosticsConfig, DiagnosticSeverity};
55-
/// # use std::collections::HashMap;
56-
/// let mut severity = HashMap::new();
57-
/// severity.insert("S".to_string(), DiagnosticSeverity::Warning);
58-
/// severity.insert("S1".to_string(), DiagnosticSeverity::Off);
59-
/// severity.insert("S100".to_string(), DiagnosticSeverity::Error);
60-
///
61-
/// let config = DiagnosticsConfig { severity };
62-
///
63-
/// assert_eq!(config.get_severity("S100"), DiagnosticSeverity::Error); // Exact
64-
/// assert_eq!(config.get_severity("S101"), DiagnosticSeverity::Off); // "S1" prefix
65-
/// assert_eq!(config.get_severity("S200"), DiagnosticSeverity::Warning); // "S" prefix
66-
/// assert_eq!(config.get_severity("T100"), DiagnosticSeverity::Error); // Default
67-
/// ```
6851
pub fn get_severity(&self, code: &str) -> DiagnosticSeverity {
6952
// First, check for exact match
7053
if let Some(&severity) = self.severity.get(code) {

0 commit comments

Comments
 (0)