Skip to content

Commit

Permalink
docs: add documentation for from_os() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jotape24 committed Jan 21, 2025
1 parent 86e8e85 commit 107d636
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/async_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,15 @@ impl AsyncResolver {
}
}

/// Creates a new `AsyncResolver` based on the operating system of the current environment.
///
/// # Panics
/// This function panics if the operating system is neither "linux" nor "windows".
///
/// # Examples
/// ```
/// let resolver = AsyncResolver::from_os();
/// ```
pub fn from_os() -> Self {
let os = env::consts::OS;
match os {
Expand Down

0 comments on commit 107d636

Please sign in to comment.