From 868850de68713cb7e1dc2ac8031d8978d801bddf Mon Sep 17 00:00:00 2001 From: Micha White Date: Sat, 7 May 2022 16:06:45 -0400 Subject: [PATCH] Moved the option variant imports --- src/items/use-declarations.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/items/use-declarations.md b/src/items/use-declarations.md index f9695f5a2..e2e202776 100644 --- a/src/items/use-declarations.md +++ b/src/items/use-declarations.md @@ -35,13 +35,15 @@ Use declarations support a number of convenient shortcuts: An example of `use` declarations: ```rust -use std::option::Option::{Some, None}; use std::collections::hash_map::{self, HashMap}; fn foo(_: T){} fn bar(map1: HashMap, map2: hash_map::HashMap){} fn main() { + // use declarations can also exist inside of functions + use std::option::Option::{Some, None}; + // Equivalent to 'foo(vec![std::option::Option::Some(1.0f64), // std::option::Option::None]);' foo(vec![Some(1.0f64), None]);