From 45923c401e038ed5cd21a344a639cbe0021badb5 Mon Sep 17 00:00:00 2001 From: timofey Date: Mon, 22 May 2023 09:56:05 +0000 Subject: [PATCH] add `r` prefixes to avoid confusion --- src/flow.rs | 2 +- src/flow/traversible/unbalanced.rs | 2 +- src/lib.rs | 4 ++-- src/{core.rs => rcore.rs} | 2 +- src/{core => rcore}/addresses.rs | 2 +- src/{core => rcore}/hashing.rs | 2 +- src/{core => rcore}/origin.rs | 0 src/{core => rcore}/point.rs | 0 src/{core => rcore}/points.rs | 0 src/{core => rcore}/resolution.rs | 0 src/{core => rcore}/resolver_origin.rs | 0 src/{core => rcore}/serialization.rs | 4 ++-- src/{core => rcore}/slice_deserializer.rs | 2 +- src/{std.rs => rstd.rs} | 4 ++-- src/{std => rstd}/atomic.rs | 2 +- src/{std => rstd}/atomic/atomic_object.rs | 0 src/{std => rstd}/atomic/boolean.rs | 2 +- src/{std => rstd}/atomic/plain.rs | 2 +- src/{std => rstd}/cast.rs | 4 ++-- src/{std => rstd}/collections.rs | 0 src/{std => rstd}/collections/pair.rs | 4 ++-- src/{std => rstd}/collections/rbtree.rs | 4 ++-- src/{std => rstd}/collections/rbtree/subset.rs | 2 +- src/{std => rstd}/collections/stack.rs | 6 +++--- src/{std => rstd}/fallible.rs | 0 src/{std => rstd}/inlining.rs | 2 +- src/{std => rstd}/inlining/static_pair.rs | 2 +- src/{std => rstd}/local_origin.rs | 2 +- src/{std => rstd}/nullable.rs | 2 +- src/{std => rstd}/point.rs | 2 +- src/{std => rstd}/tracing.rs | 2 +- src/{std => rstd}/tracing/rendered.rs | 4 ++-- src/{std => rstd}/tracing/rendered_display.rs | 0 src/{std => rstd}/tracing/trace.rs | 0 src/{std => rstd}/tracing/trace/render.rs | 2 +- src/{std => rstd}/tracing/traceable.rs | 2 +- src/{std => rstd}/tracing/traced.rs | 0 src/{std => rstd}/typeless.rs | 2 +- src/{std => rstd}/wrapped_origin.rs | 0 src/testing.rs | 6 +++--- src/testing/counted.rs | 4 ++-- src/testing/traced.rs | 4 ++-- 42 files changed, 43 insertions(+), 43 deletions(-) rename src/{core.rs => rcore.rs} (98%) rename src/{core => rcore}/addresses.rs (99%) rename src/{core => rcore}/hashing.rs (87%) rename src/{core => rcore}/origin.rs (100%) rename src/{core => rcore}/point.rs (100%) rename src/{core => rcore}/points.rs (100%) rename src/{core => rcore}/resolution.rs (100%) rename src/{core => rcore}/resolver_origin.rs (100%) rename src/{core => rcore}/serialization.rs (89%) rename src/{core => rcore}/slice_deserializer.rs (93%) rename src/{std.rs => rstd.rs} (96%) rename src/{std => rstd}/atomic.rs (98%) rename src/{std => rstd}/atomic/atomic_object.rs (100%) rename src/{std => rstd}/atomic/boolean.rs (98%) rename src/{std => rstd}/atomic/plain.rs (98%) rename src/{std => rstd}/cast.rs (99%) rename src/{std => rstd}/collections.rs (100%) rename src/{std => rstd}/collections/pair.rs (97%) rename src/{std => rstd}/collections/rbtree.rs (99%) rename src/{std => rstd}/collections/rbtree/subset.rs (99%) rename src/{std => rstd}/collections/stack.rs (98%) rename src/{std => rstd}/fallible.rs (100%) rename src/{std => rstd}/inlining.rs (99%) rename src/{std => rstd}/inlining/static_pair.rs (99%) rename src/{std => rstd}/local_origin.rs (98%) rename src/{std => rstd}/nullable.rs (99%) rename src/{std => rstd}/point.rs (99%) rename src/{std => rstd}/tracing.rs (99%) rename src/{std => rstd}/tracing/rendered.rs (99%) rename src/{std => rstd}/tracing/rendered_display.rs (100%) rename src/{std => rstd}/tracing/trace.rs (100%) rename src/{std => rstd}/tracing/trace/render.rs (98%) rename src/{std => rstd}/tracing/traceable.rs (97%) rename src/{std => rstd}/tracing/traced.rs (100%) rename src/{std => rstd}/typeless.rs (99%) rename src/{std => rstd}/wrapped_origin.rs (100%) diff --git a/src/flow.rs b/src/flow.rs index 0d4dc51..0302084 100644 --- a/src/flow.rs +++ b/src/flow.rs @@ -1,4 +1,4 @@ -//! Data structures and algorithms, independent of [`crate::core`] concepts. +//! Data structures and algorithms, independent of [`crate::rcore`] concepts. pub mod binary; pub mod traversible; diff --git a/src/flow/traversible/unbalanced.rs b/src/flow/traversible/unbalanced.rs index 9b58b5a..a42c44f 100644 --- a/src/flow/traversible/unbalanced.rs +++ b/src/flow/traversible/unbalanced.rs @@ -173,7 +173,7 @@ impl<'a, T: 'a + Monad, A: 'a> UnbalancedConstructor<'a, T, A> { mod tests { use rand::{Rng, SeedableRng}; - use crate::std::tracing::*; + use crate::rstd::tracing::*; use super::{algorithms::contains::*, algorithms::subset::*, *}; diff --git a/src/lib.rs b/src/lib.rs index a9eb7b0..faaf441 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,9 +1,9 @@ //! # RADN //! Rainbow something something Network. -pub mod core; pub mod flow; pub mod func; -pub mod std; +pub mod rcore; +pub mod rstd; #[cfg(test)] mod testing; diff --git a/src/core.rs b/src/rcore.rs similarity index 98% rename from src/core.rs rename to src/rcore.rs index 5003ff7..6da5419 100644 --- a/src/core.rs +++ b/src/rcore.rs @@ -81,7 +81,7 @@ pub type ParseResult<'a, Ctx, F> = Result<>::Mtbl, >::ParseError>; /// Trait representing deserialisation rules for [Mentionable]s. -/// Crucial for [`crate::std::typeless`]. +/// Crucial for [`crate::rstd::typeless`]. pub trait Factory<'a, Ctx: 'a + Context>: 'a + Send + Sync + Clone { /// Type of the associated objects. type Mtbl: Mentionable<'a, Ctx, Fctr = Self>; diff --git a/src/core/addresses.rs b/src/rcore/addresses.rs similarity index 99% rename from src/core/addresses.rs rename to src/rcore/addresses.rs index 2dcc507..4f14e63 100644 --- a/src/core/addresses.rs +++ b/src/rcore/addresses.rs @@ -67,7 +67,7 @@ impl<'a, Ctx: 'a + Context, F: Factory<'a, Ctx>> ExtFactory<'a, Ctx> for F { #[cfg(test)] mod tests { - use crate::core::*; + use crate::rcore::*; #[test] fn can_read_one_address() { diff --git a/src/core/hashing.rs b/src/rcore/hashing.rs similarity index 87% rename from src/core/hashing.rs rename to src/rcore/hashing.rs index e995f34..a75a049 100644 --- a/src/core/hashing.rs +++ b/src/rcore/hashing.rs @@ -5,7 +5,7 @@ use super::*; pub const HASH_SIZE: usize = 32; /// Zeroed out array of the same length as [`type@Hash`]. -/// Used in [`crate::std::nullable`]. +/// Used in [`crate::rstd::nullable`]. pub const HASH_ZEROS: [u8; HASH_SIZE] = [0; HASH_SIZE]; /// For use in [`Point`]/[`Address`]. diff --git a/src/core/origin.rs b/src/rcore/origin.rs similarity index 100% rename from src/core/origin.rs rename to src/rcore/origin.rs diff --git a/src/core/point.rs b/src/rcore/point.rs similarity index 100% rename from src/core/point.rs rename to src/rcore/point.rs diff --git a/src/core/points.rs b/src/rcore/points.rs similarity index 100% rename from src/core/points.rs rename to src/rcore/points.rs diff --git a/src/core/resolution.rs b/src/rcore/resolution.rs similarity index 100% rename from src/core/resolution.rs rename to src/rcore/resolution.rs diff --git a/src/core/resolver_origin.rs b/src/rcore/resolver_origin.rs similarity index 100% rename from src/core/resolver_origin.rs rename to src/rcore/resolver_origin.rs diff --git a/src/core/serialization.rs b/src/rcore/serialization.rs similarity index 89% rename from src/core/serialization.rs rename to src/rcore/serialization.rs index 050035a..09508d9 100644 --- a/src/core/serialization.rs +++ b/src/rcore/serialization.rs @@ -8,7 +8,7 @@ use super::*; pub trait Serializer { /// Writes bytes from a slice. Should advance value of [`Serializer::tell()`] by `buf.len()`. fn write(&mut self, buf: &[u8]); - /// Current position of the stream. Used by [`crate::std::inlining::CheckedSerialize`]. + /// Current position of the stream. Used by [`crate::rstd::inlining::CheckedSerialize`]. fn tell(&self) -> usize; } @@ -36,7 +36,7 @@ pub trait Deserializer { fn read_n(&mut self, n: usize) -> &[u8]; /// Read til the end of the stream. fn read_all(&mut self) -> &[u8]; - /// Current position of the stream. Used by [`crate::std::inlining::CheckedParse`]. + /// Current position of the stream. Used by [`crate::rstd::inlining::CheckedParse`]. fn tell(&self) -> usize; } diff --git a/src/core/slice_deserializer.rs b/src/rcore/slice_deserializer.rs similarity index 93% rename from src/core/slice_deserializer.rs rename to src/rcore/slice_deserializer.rs index f6d51f5..b19e29e 100644 --- a/src/core/slice_deserializer.rs +++ b/src/rcore/slice_deserializer.rs @@ -2,7 +2,7 @@ use std::cmp::min; use super::*; -/// [Deserializer] for slices. Used in [`ExtFactory::parse_slice`] and [`crate::std::atomic::ExtAtomic::parse_slice`]. +/// [Deserializer] for slices. Used in [`ExtFactory::parse_slice`] and [`crate::rstd::atomic::ExtAtomic::parse_slice`]. pub struct SliceDeserializer<'a> { slice: &'a [u8], pos: usize, diff --git a/src/std.rs b/src/rstd.rs similarity index 96% rename from src/std.rs rename to src/rstd.rs index a5e5633..b3e0134 100644 --- a/src/std.rs +++ b/src/rstd.rs @@ -1,4 +1,4 @@ -//! Standard extensions to [`crate::core`]. +//! Standard extensions to [`crate::rcore`]. pub mod atomic; pub mod cast; @@ -14,8 +14,8 @@ mod wrapped_origin; use std::{error::Error, fmt::Display, rc::Rc}; -use crate::core::*; use crate::func::*; +use crate::rcore::*; impl Display for Address { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/src/std/atomic.rs b/src/rstd/atomic.rs similarity index 98% rename from src/std/atomic.rs rename to src/rstd/atomic.rs index d958436..822aec7 100644 --- a/src/std/atomic.rs +++ b/src/rstd/atomic.rs @@ -7,7 +7,7 @@ pub mod plain; use std::marker::PhantomData; -use crate::core::*; +use crate::rcore::*; use super::*; diff --git a/src/std/atomic/atomic_object.rs b/src/rstd/atomic/atomic_object.rs similarity index 100% rename from src/std/atomic/atomic_object.rs rename to src/rstd/atomic/atomic_object.rs diff --git a/src/std/atomic/boolean.rs b/src/rstd/atomic/boolean.rs similarity index 98% rename from src/std/atomic/boolean.rs rename to src/rstd/atomic/boolean.rs index c38f212..6788494 100644 --- a/src/std/atomic/boolean.rs +++ b/src/rstd/atomic/boolean.rs @@ -1,4 +1,4 @@ -use crate::std::inlining::*; +use crate::rstd::inlining::*; use super::*; diff --git a/src/std/atomic/plain.rs b/src/rstd/atomic/plain.rs similarity index 98% rename from src/std/atomic/plain.rs rename to src/rstd/atomic/plain.rs index 19b40e1..b44f913 100644 --- a/src/std/atomic/plain.rs +++ b/src/rstd/atomic/plain.rs @@ -58,7 +58,7 @@ impl Plain { #[cfg(test)] mod tests { use super::*; - use crate::std::*; + use crate::rstd::*; #[test] fn can_parse_plain_slice() -> Result<(), PlainParseError> { diff --git a/src/std/cast.rs b/src/rstd/cast.rs similarity index 99% rename from src/std/cast.rs rename to src/rstd/cast.rs index 3ee8ef3..53d7e6b 100644 --- a/src/std/cast.rs +++ b/src/rstd/cast.rs @@ -1,11 +1,11 @@ -//! Utilities to convert from typeless instances defined in [`crate::core`]. +//! Utilities to convert from typeless instances defined in [`crate::rcore`]. //! See [`TypelessMentionable::cast`]/[`Point::cast`]. //! //! p.s. the implementation is horrific. use std::convert::identity; -use crate::core::*; +use crate::rcore::*; use super::{typeless::*, wrapped_origin::*, *}; diff --git a/src/std/collections.rs b/src/rstd/collections.rs similarity index 100% rename from src/std/collections.rs rename to src/rstd/collections.rs diff --git a/src/std/collections/pair.rs b/src/rstd/collections/pair.rs similarity index 97% rename from src/std/collections/pair.rs rename to src/rstd/collections/pair.rs index c841386..cc69b86 100644 --- a/src/std/collections/pair.rs +++ b/src/rstd/collections/pair.rs @@ -3,8 +3,8 @@ use std::error::Error; use std::fmt::Display; -use crate::core::*; -use crate::std::inlining::{static_pair::*, *}; +use crate::rcore::*; +use crate::rstd::inlining::{static_pair::*, *}; #[derive(Clone)] pub struct Pair { diff --git a/src/std/collections/rbtree.rs b/src/rstd/collections/rbtree.rs similarity index 99% rename from src/std/collections/rbtree.rs rename to src/rstd/collections/rbtree.rs index 0ccbef9..b4c438f 100644 --- a/src/std/collections/rbtree.rs +++ b/src/rstd/collections/rbtree.rs @@ -2,8 +2,8 @@ pub mod subset; use std::{error::Error, fmt::Display, rc::Rc}; -use crate::core::*; -use crate::std::{ +use crate::rcore::*; +use crate::rstd::{ atomic::{boolean::*, *}, nullable::*, point::*, diff --git a/src/std/collections/rbtree/subset.rs b/src/rstd/collections/rbtree/subset.rs similarity index 99% rename from src/std/collections/rbtree/subset.rs rename to src/rstd/collections/rbtree/subset.rs index e30c178..c8f1c00 100644 --- a/src/std/collections/rbtree/subset.rs +++ b/src/rstd/collections/rbtree/subset.rs @@ -2,7 +2,7 @@ use std::rc::Rc; use crate::flow::traversible::*; use crate::func::*; -use crate::std::{fallible::*, *}; +use crate::rstd::{fallible::*, *}; use super::*; diff --git a/src/std/collections/stack.rs b/src/rstd/collections/stack.rs similarity index 98% rename from src/std/collections/stack.rs rename to src/rstd/collections/stack.rs index 2ff17b8..abf2687 100644 --- a/src/std/collections/stack.rs +++ b/src/rstd/collections/stack.rs @@ -1,7 +1,7 @@ //! Basic implementation of a stack/linked list. -use crate::core::*; -use crate::std::{inlining::*, nullable::*, point::*, *}; +use crate::rcore::*; +use crate::rstd::{inlining::*, nullable::*, point::*, *}; /// Node containing a (nullable) reference to the next node and an element. pub struct StackNode<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> { @@ -205,7 +205,7 @@ where mod tests { use std::rc::Rc; - use crate::std::{ + use crate::rstd::{ atomic::{atomic_object::*, plain::*}, tracing::*, }; diff --git a/src/std/fallible.rs b/src/rstd/fallible.rs similarity index 100% rename from src/std/fallible.rs rename to src/rstd/fallible.rs diff --git a/src/std/inlining.rs b/src/rstd/inlining.rs similarity index 99% rename from src/std/inlining.rs rename to src/rstd/inlining.rs index 36cc91e..cc611e6 100644 --- a/src/std/inlining.rs +++ b/src/rstd/inlining.rs @@ -2,7 +2,7 @@ pub mod static_pair; -use crate::core::*; +use crate::rcore::*; use super::{ atomic::{atomic_object::*, *}, diff --git a/src/std/inlining/static_pair.rs b/src/rstd/inlining/static_pair.rs similarity index 99% rename from src/std/inlining/static_pair.rs rename to src/rstd/inlining/static_pair.rs index 384b1c3..adb65ba 100644 --- a/src/std/inlining/static_pair.rs +++ b/src/rstd/inlining/static_pair.rs @@ -3,7 +3,7 @@ use std::ops::Deref; -use crate::std::*; +use crate::rstd::*; use super::*; diff --git a/src/std/local_origin.rs b/src/rstd/local_origin.rs similarity index 98% rename from src/std/local_origin.rs rename to src/rstd/local_origin.rs index 25aaac7..61f9f9f 100644 --- a/src/std/local_origin.rs +++ b/src/rstd/local_origin.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use crate::core::*; +use crate::rcore::*; use super::*; diff --git a/src/std/nullable.rs b/src/rstd/nullable.rs similarity index 99% rename from src/std/nullable.rs rename to src/rstd/nullable.rs index 3421355..617c456 100644 --- a/src/std/nullable.rs +++ b/src/rstd/nullable.rs @@ -1,6 +1,6 @@ //! This module introduces [`Option`]-like concepts into RADN typesystem using [`Nullable`]. -use crate::core::*; +use crate::rcore::*; use super::{inlining::*, point::*, *}; diff --git a/src/std/point.rs b/src/rstd/point.rs similarity index 99% rename from src/std/point.rs rename to src/rstd/point.rs index 60d4144..c6ed034 100644 --- a/src/std/point.rs +++ b/src/rstd/point.rs @@ -2,7 +2,7 @@ use std::{error::Error, fmt::Display, rc::Rc}; -use crate::core::*; +use crate::rcore::*; impl<'a, Ctx: 'a + Context, A: Mentionable<'a, Ctx>> Serializable for Point<'a, Ctx, A> { fn serialize(&self, serializer: &mut dyn Serializer) { diff --git a/src/std/tracing.rs b/src/rstd/tracing.rs similarity index 99% rename from src/std/tracing.rs rename to src/rstd/tracing.rs index e338b47..becc9ad 100644 --- a/src/std/tracing.rs +++ b/src/rstd/tracing.rs @@ -6,7 +6,7 @@ mod trace; mod traceable; mod traced; -use crate::core::*; +use crate::rcore::*; use super::*; diff --git a/src/std/tracing/rendered.rs b/src/rstd/tracing/rendered.rs similarity index 99% rename from src/std/tracing/rendered.rs rename to src/rstd/tracing/rendered.rs index 3ebf49e..4b6d6b4 100644 --- a/src/std/tracing/rendered.rs +++ b/src/rstd/tracing/rendered.rs @@ -1,9 +1,9 @@ use std::cmp::max; -#[cfg(doc)] -use crate::core::*; #[cfg(doc)] use crate::func::*; +#[cfg(doc)] +use crate::rcore::*; #[cfg(doc)] use super::*; diff --git a/src/std/tracing/rendered_display.rs b/src/rstd/tracing/rendered_display.rs similarity index 100% rename from src/std/tracing/rendered_display.rs rename to src/rstd/tracing/rendered_display.rs diff --git a/src/std/tracing/trace.rs b/src/rstd/tracing/trace.rs similarity index 100% rename from src/std/tracing/trace.rs rename to src/rstd/tracing/trace.rs diff --git a/src/std/tracing/trace/render.rs b/src/rstd/tracing/trace/render.rs similarity index 98% rename from src/std/tracing/trace/render.rs rename to src/rstd/tracing/trace/render.rs index 190d2de..e75ab5f 100644 --- a/src/std/tracing/trace/render.rs +++ b/src/rstd/tracing/trace/render.rs @@ -1,4 +1,4 @@ -use crate::std::tracing::{rendered::*, *}; +use crate::rstd::tracing::{rendered::*, *}; use super::*; diff --git a/src/std/tracing/traceable.rs b/src/rstd/tracing/traceable.rs similarity index 97% rename from src/std/tracing/traceable.rs rename to src/rstd/tracing/traceable.rs index 196e910..6bdcef5 100644 --- a/src/std/tracing/traceable.rs +++ b/src/rstd/tracing/traceable.rs @@ -1,4 +1,4 @@ -use crate::std::{cast::*, typeless::*}; +use crate::rstd::{cast::*, typeless::*}; use super::*; diff --git a/src/std/tracing/traced.rs b/src/rstd/tracing/traced.rs similarity index 100% rename from src/std/tracing/traced.rs rename to src/rstd/tracing/traced.rs diff --git a/src/std/typeless.rs b/src/rstd/typeless.rs similarity index 99% rename from src/std/typeless.rs rename to src/rstd/typeless.rs index 9daf146..9a52b11 100644 --- a/src/std/typeless.rs +++ b/src/rstd/typeless.rs @@ -1,4 +1,4 @@ -//! Previously part of [`crate::core`]. +//! Previously part of [`crate::rcore`]. use super::{wrapped_origin::*, *}; diff --git a/src/std/wrapped_origin.rs b/src/rstd/wrapped_origin.rs similarity index 100% rename from src/std/wrapped_origin.rs rename to src/rstd/wrapped_origin.rs diff --git a/src/testing.rs b/src/testing.rs index 8ac1bdc..d82c4a4 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -5,10 +5,10 @@ use std::{error::Error, fmt::Display, rc::Rc}; use sha2::{Digest, Sha256}; -use crate::core::*; use crate::func::*; -use crate::std::cast::*; -use crate::std::typeless::*; +use crate::rcore::*; +use crate::rstd::cast::*; +use crate::rstd::typeless::*; pub struct NoDiagnostic; diff --git a/src/testing/counted.rs b/src/testing/counted.rs index 0a9c86f..511ffad 100644 --- a/src/testing/counted.rs +++ b/src/testing/counted.rs @@ -1,8 +1,8 @@ use std::cmp::max; -use crate::core::*; use crate::func::*; -use crate::std::typeless::*; +use crate::rcore::*; +use crate::rstd::typeless::*; use super::*; diff --git a/src/testing/traced.rs b/src/testing/traced.rs index 550306d..094484f 100644 --- a/src/testing/traced.rs +++ b/src/testing/traced.rs @@ -1,5 +1,5 @@ -use crate::core::*; -use crate::std::tracing::*; +use crate::rcore::*; +use crate::rstd::tracing::*; use super::*;