From 107d636add9cf45edcb032d1047e0b5b0f660e93 Mon Sep 17 00:00:00 2001 From: jotape24 Date: Tue, 21 Jan 2025 13:06:44 -0300 Subject: [PATCH] docs: add documentation for from_os() method --- src/async_resolver.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/async_resolver.rs b/src/async_resolver.rs index 3420ac01..69a88f4d 100644 --- a/src/async_resolver.rs +++ b/src/async_resolver.rs @@ -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 {