Skip to content

Commit

Permalink
[all] Upgrade al the crates to their latest versions
Browse files Browse the repository at this point in the history
- Drop some needless files from macro crate
- Update rust-toolchain.toml to use nightly
- Add `all` option to `run.nu` which can be used in CI/CD (whenever that is set up)
- Update tests to accomodate dropping palette and replace w/ colorgrad crate

Fixes: #171
  • Loading branch information
nazmulidris committed Oct 22, 2023
1 parent 3c74879 commit 362eb57
Show file tree
Hide file tree
Showing 44 changed files with 259 additions and 626 deletions.
4 changes: 2 additions & 2 deletions ansi_color/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ license = "Apache-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
is-terminal = "0.4.0"
is-terminal = "0.4.9"
is_ci = "1.1.1"

[dev-dependencies]
pretty_assertions = "1.2.1"
pretty_assertions = "1.4.0"
serial_test = "2.0.0"
4 changes: 2 additions & 2 deletions ansi_color/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "stable"
# channel = "nightly"
# channel = "stable"
channel = "nightly"
11 changes: 7 additions & 4 deletions ansi_color/src/ansi_styled_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ pub enum Style {
mod style_impl {
use std::fmt::{Display, Formatter, Result};

use crate::{
global_color_support, Color, ColorSupport, RgbColor, SgrCode, Style,
TransformColor,
};
use crate::{global_color_support,
Color,
ColorSupport,
RgbColor,
SgrCode,
Style,
TransformColor};

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum ColorKind {
Expand Down
22 changes: 9 additions & 13 deletions ansi_color/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,9 @@ mod rgb_color_impl {
use crate::{convert_rgb_into_ansi256, Ansi256Color};

impl TransformColor for RgbColor {
fn as_rgb(&self) -> RgbColor {
*self
}
fn as_rgb(&self) -> RgbColor { *self }

fn as_ansi256(&self) -> Ansi256Color {
convert_rgb_into_ansi256(*self)
}
fn as_ansi256(&self) -> Ansi256Color { convert_rgb_into_ansi256(*self) }

fn as_grayscale(&self) -> Ansi256Color {
convert_rgb_into_ansi256(*self).as_grayscale()
Expand All @@ -116,10 +112,12 @@ pub struct Ansi256Color {
}

mod ansi_color_impl {
use crate::{
color_utils, constants::ANSI_COLOR_PALETTE, Ansi256Color, Color, RgbColor,
TransformColor,
};
use crate::{color_utils,
constants::ANSI_COLOR_PALETTE,
Ansi256Color,
Color,
RgbColor,
TransformColor};

impl TransformColor for Ansi256Color {
fn as_grayscale(&self) -> Ansi256Color {
Expand All @@ -135,8 +133,6 @@ mod ansi_color_impl {
ANSI_COLOR_PALETTE[index].into()
}

fn as_ansi256(&self) -> Ansi256Color {
*self
}
fn as_ansi256(&self) -> Ansi256Color { *self }
}
}
6 changes: 2 additions & 4 deletions ansi_color/src/detect_color_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
* limitations under the License.
*/

use std::{
env,
sync::atomic::{AtomicI8, Ordering},
};
use std::{env,
sync::atomic::{AtomicI8, Ordering}};

/// Global variable which can be used to:
/// 1. Override the color support.
Expand Down
4 changes: 2 additions & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ r3bl_simple_logger = { path = "../simple_logger", version = "0.1.1" } # For logg
log = { version = "0.4.20", features = ["std"] } # For logging.

tokio = { version = "1.33.0", features = ["full"] }
async-trait = "0.1.73"
async-trait = "0.1.74"

# https://github.com/serde-rs/serde.
serde = { version = "1.0.189", features = ["derive"] }
Expand All @@ -52,7 +52,7 @@ get-size = { version = "0.1.4", features = ["derive"] }

# Time
chrono = "0.4.31"
time = "0.3.29"
time = "0.3.30"

# Syntax highlighting.
syntect = "5.1.0"
Expand Down
4 changes: 2 additions & 2 deletions core/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "stable"
# channel = "nightly"
# channel = "stable"
channel = "nightly"
16 changes: 4 additions & 12 deletions core/src/tui_core/graphemes/unicode_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,11 @@ mod grapheme_cluster_segment_impl {
}

impl From<&str> for GraphemeClusterSegment {
fn from(s: &str) -> Self {
GraphemeClusterSegment::new(s)
}
fn from(s: &str) -> Self { GraphemeClusterSegment::new(s) }
}

impl From<String> for GraphemeClusterSegment {
fn from(s: String) -> Self {
GraphemeClusterSegment::new(&s)
}
fn from(s: String) -> Self { GraphemeClusterSegment::new(&s) }
}
}

Expand Down Expand Up @@ -130,14 +126,10 @@ mod unicode_string_impl {
impl Deref for UnicodeString {
type Target = Vec<GraphemeClusterSegment>;

fn deref(&self) -> &Self::Target {
&self.vec_segment
}
fn deref(&self) -> &Self::Target { &self.vec_segment }
}

impl DerefMut for UnicodeString {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.vec_segment
}
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.vec_segment }
}
}
12 changes: 6 additions & 6 deletions macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ path = "src/lib.rs"
r3bl_rs_utils_core = { version = "0.9.7", path = "../core" }

# https://github.com/dtolnay/proc-macro-workshop#debugging-tips
syn = { version = "1.0.109", features = [
syn = { version = "2.0.38", features = [
"extra-traits",
"full",
"derive",
"parsing",
] }
quote = "1.0.26"
proc-macro2 = "1.0.56"
quote = "1.0.33"
proc-macro2 = "1.0.69"

# Crossterm & EventStream support.
crossterm = { version = "0.26.1", features = ["event-stream"] }
crossterm = { version = "0.27.0", features = ["event-stream"] }
futures-util = "0.3.28"
paste = "1.0.12"
paste = "1.0.14"

# For assert_eq2! macro.
pretty_assertions = "1.3.0"
pretty_assertions = "1.4.0"
4 changes: 2 additions & 2 deletions macro/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "stable"
# channel = "nightly"
# channel = "stable"
channel = "nightly"
68 changes: 0 additions & 68 deletions macro/src/utils/attribute_args_ext.rs

This file was deleted.

77 changes: 0 additions & 77 deletions macro/src/utils/meta_ext.rs

This file was deleted.

6 changes: 0 additions & 6 deletions macro/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,13 @@
* limitations under the License.
*/

pub mod attribute_args_ext;
pub mod data_ext;
pub mod ident_ext;
pub mod meta_ext;
pub mod nested_meta_ext;
pub mod syn_parser_helpers;
pub mod type_ext;

// Re-export.
pub use attribute_args_ext::*;
pub use data_ext::*;
pub use ident_ext::*;
pub use meta_ext::*;
pub use nested_meta_ext::*;
pub use syn_parser_helpers::*;
pub use type_ext::*;
39 changes: 0 additions & 39 deletions macro/src/utils/nested_meta_ext.rs

This file was deleted.

Loading

0 comments on commit 362eb57

Please sign in to comment.