diff options
Diffstat (limited to 'crates/assists')
-rw-r--r-- | crates/assists/src/utils.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/crates/assists/src/utils.rs b/crates/assists/src/utils.rs index 7071fe96b..7bd338e99 100644 --- a/crates/assists/src/utils.rs +++ b/crates/assists/src/utils.rs | |||
@@ -257,6 +257,12 @@ pub mod convert { | |||
257 | } | 257 | } |
258 | } | 258 | } |
259 | 259 | ||
260 | pub mod default { | ||
261 | pub trait Default { | ||
262 | fn default() -> Self; | ||
263 | } | ||
264 | } | ||
265 | |||
260 | pub mod iter { | 266 | pub mod iter { |
261 | pub use self::traits::{collect::IntoIterator, iterator::Iterator}; | 267 | pub use self::traits::{collect::IntoIterator, iterator::Iterator}; |
262 | mod traits { | 268 | mod traits { |
@@ -327,7 +333,7 @@ pub mod option { | |||
327 | } | 333 | } |
328 | 334 | ||
329 | pub mod prelude { | 335 | pub mod prelude { |
330 | pub use crate::{convert::From, iter::{IntoIterator, Iterator}, option::Option::{self, *}}; | 336 | pub use crate::{convert::From, iter::{IntoIterator, Iterator}, option::Option::{self, *}, default::Default}; |
331 | } | 337 | } |
332 | #[prelude_import] | 338 | #[prelude_import] |
333 | pub use prelude::*; | 339 | pub use prelude::*; |
@@ -345,6 +351,10 @@ pub use prelude::*; | |||
345 | self.find_enum("core:option:Option") | 351 | self.find_enum("core:option:Option") |
346 | } | 352 | } |
347 | 353 | ||
354 | pub fn core_default_Default(&self) -> Option<Trait> { | ||
355 | self.find_trait("core:default:Default") | ||
356 | } | ||
357 | |||
348 | pub fn core_iter_Iterator(&self) -> Option<Trait> { | 358 | pub fn core_iter_Iterator(&self) -> Option<Trait> { |
349 | self.find_trait("core:iter:traits:iterator:Iterator") | 359 | self.find_trait("core:iter:traits:iterator:Iterator") |
350 | } | 360 | } |