Skip to content

Commit

Permalink
Merge pull request #10 from jymchng/feature/feature-gates
Browse files Browse the repository at this point in the history
Feature/feature gates
  • Loading branch information
jymchng authored Apr 2, 2024
2 parents e8e3144 + ede316e commit c3cb1d6
Show file tree
Hide file tree
Showing 20 changed files with 16 additions and 1,292 deletions.
13 changes: 11 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "typenum-consts"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
authors = ["Jim Chng <[email protected]>"]
exclude = [
Expand Down Expand Up @@ -37,7 +37,7 @@ quote = "1.0.35"
syn = { version = "2.0.53", features = ["extra-traits", "full"] }
typenum = "1.17.0"
dotenv = "0.15.0"
peekmore = "1.0.0"
rsc = "3.0.0"

[dev-dependencies]
trybuild = "1.0.90"
Expand Down
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,6 @@ assert_type_eq!(E, P69);
- [ ] Feature gate evaluation of mathematical expressions and reading from environment variables.
- [ ] Enable testing for Rust version 1.70.

# Vendored Crates

## [`rsc`](https://github.com/fivemoreminix/rsc/commit/67c4ddffbe45a30de0fd696c569de885bfd4e9b4) version 3.0.0

Reasons for vendoring `rsc`.

1. As of 28 March 2024, there is a version 3.0.0 of the crate on the GitHub [repository](https://github.com/fivemoreminix/rsc/commit/67c4ddffbe45a30de0fd696c569de885bfd4e9b4) but without a corresponding crate on `crates.io`.
2. Easier to implement `Num` for `isize` with vendoring.
3. `typenum-const needs a mathematical expression evaluator.
4. Its [license](https://github.com/fivemoreminix/rsc/tree/67c4ddffbe45a30de0fd696c569de885bfd4e9b4?tab=readme-ov-file#license) allows for 'usage without attribution'. Anyway, `src/vendors/rsc/Cargo.toml.vendored` is the original `Cargo.toml` file found in the repository.
5. Thanks to [Luke Wilson](https://github.com/fivemoreminix).

## License

Licensed under either of
Expand Down
2 changes: 1 addition & 1 deletion src/ast_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CARGO_ENV_DIRS: [&str; 3] = [CARGO_BUILD_TARGET_DIR, CARGO_MANIFEST_DIR, C
impl EnvArgs {
fn check_string_cannot_be_empty(
&self,
string: &String,
string: &str,
error_span: Span,
name: &str,
) -> Result<()> {
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ use crate::ast::{
};
use crate::macros::debug_eprintln;
use proc_macro::{self, TokenStream};
#[allow(clippy::all)]
use rsc;
use tnconst_impl::{
nconst_impl_lit_integer, nconst_impl_math_exprs, pconst_impl_lit_integer,
pconst_impl_math_exprs, tnconst_impl_lit_integer, tnconst_impl_math_exprs,
uconst_impl_lit_integer, uconst_impl_math_exprs,
};
#[allow(clippy::all)]
use vendors::rsc;

mod ast;
mod ast_macro;
mod exprs_impl;
mod macros;
mod tnconst_impl;
mod uconst_impl;
mod vendors;

/// [`uconst!`] is a procedural macro that converts a literal integer or an expression into a [`typenum`]'s type-level unsigned integer (i.e. the type that implements the [`typenum::Unsigned`] trait).
///
Expand Down
1 change: 0 additions & 1 deletion src/vendors/mod.rs

This file was deleted.

4 changes: 0 additions & 4 deletions src/vendors/rsc/.gitignore

This file was deleted.

47 changes: 0 additions & 47 deletions src/vendors/rsc/CHANGELOG.md

This file was deleted.

29 changes: 0 additions & 29 deletions src/vendors/rsc/Cargo.toml.vendored

This file was deleted.

21 changes: 0 additions & 21 deletions src/vendors/rsc/LICENSE

This file was deleted.

140 changes: 0 additions & 140 deletions src/vendors/rsc/README.md

This file was deleted.

Loading

0 comments on commit c3cb1d6

Please sign in to comment.