diff options
Diffstat (limited to 'ext/fs/sync.rs')
-rw-r--r-- | ext/fs/sync.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/fs/sync.rs b/ext/fs/sync.rs new file mode 100644 index 000000000..c43850c28 --- /dev/null +++ b/ext/fs/sync.rs @@ -0,0 +1,22 @@ +// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. + +pub use inner::*; + +#[cfg(feature = "sync_fs")] +mod inner { + #![allow(clippy::disallowed_types)] + pub use std::sync::Arc as MaybeArc; + + pub use core::marker::Send as MaybeSend; + pub use core::marker::Sync as MaybeSync; +} + +#[cfg(not(feature = "sync_fs"))] +mod inner { + pub use std::rc::Rc as MaybeArc; + + pub trait MaybeSync {} + impl<T> MaybeSync for T where T: ?Sized {} + pub trait MaybeSend {} + impl<T> MaybeSend for T where T: ?Sized {} +} |