Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
Update to Rust 1.70
Alexis Sellier committed 2 years ago
commit 4652f309b41c6a70b44b1fed0657e925940eb660
parent fd91cf4d28bd370a6c5beb9ca158e4d91432df25
15 files changed +17 -38
modified Cargo.lock
@@ -2164,7 +2164,6 @@ dependencies = [
 "anstyle-query",
 "anyhow",
 "inquire",
-
 "is-terminal",
 "libc",
 "once_cell",
 "pretty_assertions",
modified radicle-cli/src/commands/id.rs
@@ -48,7 +48,7 @@ impl Metadata {
        let yaml = serde_yaml::to_string(&self)?;
        match term::Editor::new().edit(yaml)? {
            Some(meta) => Ok(serde_yaml::from_str(&meta).context("failed to parse proposal meta")?),
-
            None => return Err(anyhow!("Operation aborted!")),
+
            None => Err(anyhow!("Operation aborted!")),
        }
    }
}
modified radicle-cli/src/terminal.rs
@@ -55,7 +55,7 @@ where
    A: Args,
    C: Command<A, fn() -> anyhow::Result<Profile>>,
{
-
    let args = std::env::args_os().into_iter().skip(1).collect();
+
    let args = std::env::args_os().skip(1).collect();

    run_command_args(help, action, cmd, args)
}
modified radicle-cli/src/terminal/args.rs
@@ -33,7 +33,7 @@ pub struct Help {

pub trait Args: Sized {
    fn from_env() -> anyhow::Result<Self> {
-
        let args: Vec<_> = std::env::args_os().into_iter().skip(1).collect();
+
        let args: Vec<_> = std::env::args_os().skip(1).collect();

        match Self::from_args(args) {
            Ok((opts, unparsed)) => {
modified radicle-cli/src/terminal/patch.rs
@@ -1,4 +1,5 @@
use std::io;
+
use std::io::IsTerminal as _;

use radicle::git;

@@ -21,7 +22,7 @@ impl Message {
    pub fn get(self, help: &str) -> std::io::Result<String> {
        let comment = match self {
            Message::Edit => {
-
                if term::is_terminal(&io::stderr()) {
+
                if io::stderr().is_terminal() {
                    term::Editor::new().extension("markdown").edit(help)?
                } else {
                    Some(help.to_owned())
modified radicle-node/src/address/store.rs
@@ -533,7 +533,7 @@ mod test {
                .unwrap();
        }

-
        let mut actual = cache.entries().unwrap().into_iter().collect::<Vec<_>>();
+
        let mut actual = cache.entries().unwrap().collect::<Vec<_>>();

        actual.sort_by_key(|(i, _)| *i);
        expected.sort_by_key(|(i, _)| *i);
modified radicle-term/Cargo.toml
@@ -8,7 +8,6 @@ edition = "2021"
[dependencies]
anyhow = { version = "1" }
anstyle-query = { version = "1.0.0" }
-
is-terminal = { version = "0.4.4" }
inquire = { version = "0.6", default-features = false, features = ["termion", "editor"] }
libc = { version = "0.2" }
once_cell = { version = "1.13" }
modified radicle-term/src/ansi/paint.rs
@@ -1,8 +1,8 @@
+
use std::io::IsTerminal as _;
use std::sync;
use std::sync::atomic::AtomicBool;
use std::{fmt, io};

-
use is_terminal::IsTerminal;
use unicode_width::UnicodeWidthStr;

use super::color::Color;
modified radicle-term/src/lib.rs
@@ -20,25 +20,19 @@ pub use element::{Element, Line, Max, Size};
pub use hstack::HStack;
pub use inquire::ui::Styled;
pub use io::*;
-
pub use is_terminal::is_terminal;
pub use label::{label, Label};
pub use spinner::{spinner, spinner_to, Spinner};
pub use table::Table;
pub use textarea::{textarea, TextArea};
pub use vstack::{VStack, VStackOptions};

-
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
+
#[derive(Debug, PartialEq, Eq, Copy, Clone, Default)]
pub enum Interactive {
    Yes,
+
    #[default]
    No,
}

-
impl Default for Interactive {
-
    fn default() -> Self {
-
        Interactive::No
-
    }
-
}
-

impl Interactive {
    pub fn yes(&self) -> bool {
        (*self).into()
modified radicle-tui/src/app/page.rs
@@ -121,10 +121,7 @@ impl ViewPage for HomeView {
    fn subscribe(&self, app: &mut Application<Cid, Message, NoUserEvent>) -> Result<()> {
        app.subscribe(
            &Cid::Home(HomeCid::Navigation),
-
            Sub::new(
-
                subscription::navigation_clause::<Cid, _>(),
-
                SubClause::Always,
-
            ),
+
            Sub::new(subscription::navigation_clause(), SubClause::Always),
        )?;

        Ok(())
@@ -133,7 +130,7 @@ impl ViewPage for HomeView {
    fn unsubscribe(&self, app: &mut Application<Cid, Message, NoUserEvent>) -> Result<()> {
        app.unsubscribe(
            &Cid::Home(HomeCid::Navigation),
-
            subscription::navigation_clause::<Cid, _>(),
+
            subscription::navigation_clause(),
        )?;

        Ok(())
@@ -199,10 +196,7 @@ impl ViewPage for IssuePage {
    fn subscribe(&self, app: &mut Application<Cid, Message, NoUserEvent>) -> Result<()> {
        app.subscribe(
            &Cid::Home(HomeCid::Navigation),
-
            Sub::new(
-
                subscription::navigation_clause::<Cid, _>(),
-
                SubClause::Always,
-
            ),
+
            Sub::new(subscription::navigation_clause(), SubClause::Always),
        )?;

        Ok(())
@@ -211,7 +205,7 @@ impl ViewPage for IssuePage {
    fn unsubscribe(&self, app: &mut Application<Cid, Message, NoUserEvent>) -> Result<()> {
        app.unsubscribe(
            &Cid::Home(HomeCid::Navigation),
-
            subscription::navigation_clause::<Cid, _>(),
+
            subscription::navigation_clause(),
        )?;

        Ok(())
@@ -287,10 +281,7 @@ impl ViewPage for PatchView {
    fn subscribe(&self, app: &mut Application<Cid, Message, NoUserEvent>) -> Result<()> {
        app.subscribe(
            &Cid::Patch(PatchCid::Navigation),
-
            Sub::new(
-
                subscription::navigation_clause::<Cid, _>(),
-
                SubClause::Always,
-
            ),
+
            Sub::new(subscription::navigation_clause(), SubClause::Always),
        )?;

        Ok(())
@@ -299,7 +290,7 @@ impl ViewPage for PatchView {
    fn unsubscribe(&self, app: &mut Application<Cid, Message, NoUserEvent>) -> Result<()> {
        app.unsubscribe(
            &Cid::Patch(PatchCid::Navigation),
-
            subscription::navigation_clause::<Cid, _>(),
+
            subscription::navigation_clause(),
        )?;

        Ok(())
modified radicle-tui/src/app/subscription.rs
@@ -3,9 +3,8 @@ use std::hash::Hash;
use tuirealm::event::{Key, KeyEvent, KeyModifiers};
use tuirealm::{Sub, SubClause, SubEventClause};

-
pub fn navigation_clause<Id, UserEvent>() -> SubEventClause<UserEvent>
+
pub fn navigation_clause<UserEvent>() -> SubEventClause<UserEvent>
where
-
    Id: Clone + Hash + Eq + PartialEq,
    UserEvent: Clone + Eq + PartialEq + PartialOrd,
{
    SubEventClause::Keyboard(KeyEvent {
modified radicle-tui/src/cob/patch.rs
@@ -18,7 +18,6 @@ pub fn load_all(profile: &Profile, id: Id) -> Vec<(PatchId, Patch)> {
pub fn load_proposed(repository: &Repository) -> Result<Vec<(PatchId, Patch)>> {
    let proposed = Patches::open(repository)?
        .proposed()?
-
        .into_iter()
        .map(|(id, patch, _)| (id, patch))
        .collect();

modified radicle/src/cob/patch.rs
@@ -1231,7 +1231,6 @@ impl<'a> Patches<'a> {

        let result = self
            .all()?
-
            .into_iter()
            .filter_map(|result| result.ok())
            .find_map(|(p_id, p, _)| p.revision(id).map(|r| (p_id, p.clone(), r.clone())));
        Ok(result)
modified radicle/src/rad.rs
@@ -474,14 +474,12 @@ mod tests {
            copy.find_remote(&REMOTE_NAME)
                .unwrap()
                .refspecs()
-
                .into_iter()
                .map(|r| r.bytes().to_vec())
                .collect::<Vec<_>>(),
            original
                .find_remote(&REMOTE_NAME)
                .unwrap()
                .refspecs()
-
                .into_iter()
                .map(|r| r.bytes().to_vec())
                .collect::<Vec<_>>(),
        );
modified rust-toolchain
@@ -1 +1 @@
-
1.67
+
1.70