-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This approach still allows using the same files for Rc and Arc while preventing imports from leaking as well as working better with rust-analyzer.
- Loading branch information
1 parent
b981974
commit d60808c
Showing
5 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
use std::sync::Arc as Rc; | ||
|
||
use crate::ImplicitClone; | ||
use std::fmt; | ||
|
||
type Rc<T> = std::sync::Arc<T>; | ||
#[path = "array.rs"] | ||
mod array; | ||
#[cfg(feature = "map")] | ||
#[path = "map.rs"] | ||
mod map; | ||
#[path = "string.rs"] | ||
mod string; | ||
|
||
include!("string.rs"); | ||
include!("array.rs"); | ||
pub use array::IArray; | ||
#[cfg(feature = "map")] | ||
include!("map.rs"); | ||
pub use map::IMap; | ||
pub use string::IString; | ||
|
||
impl<T: ?Sized> ImplicitClone for Rc<T> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
use crate::ImplicitClone; | ||
use std::fmt; | ||
use std::rc::Rc; | ||
|
||
include!("string.rs"); | ||
include!("array.rs"); | ||
use crate::ImplicitClone; | ||
|
||
#[path = "array.rs"] | ||
mod array; | ||
#[cfg(feature = "map")] | ||
#[path = "map.rs"] | ||
mod map; | ||
#[path = "string.rs"] | ||
mod string; | ||
|
||
pub use array::IArray; | ||
#[cfg(feature = "map")] | ||
include!("map.rs"); | ||
pub use map::IMap; | ||
pub use string::IString; | ||
|
||
impl<T: ?Sized> ImplicitClone for Rc<T> {} |