Remove `lazy_static` dependency

finchie
May 16, 2025, 6:28 AM
SCUBUHIAJXL432QBYNOGDYX2THRCZY3LPY3T3IZG7BYE52ERGFUQC

Dependencies

  • [2] 4RQHY7LH Support parsing lowercase base32
  • [3] DGHQ46S3 Refactor `pijul_interaction::progress` to use `InteractionContext`
  • [4] OGJFEWHU Fixing missing dependencies on partial clones
  • [5] N26HD5PF Replace `chrono` with `jiff`
  • [6] 4RV7T4SR Migrate from `pijul::config` to `pijul-config`
  • [7] OYN2YVPA Create `pijul_remote` crate
  • [8] SLJ3OHD4 unrecord: show list of changes if none were given as arguments
  • [9] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [10] SZWBLWZ4 Reading ~/.ssh/config
  • [11] L5IUD2DS Fixing the regular expression parsing the protocol lines
  • [12] FXEDPLRI Resurrecting tests, and type cleanup (no need for Arc<RwLock<…>> anymore)
  • [13] X6YFD4WV Do not download changes if we already have them
  • [14] 5FI6SBEZ Re-implement change printing and parsing
  • [15] EJ7TFFOW Re-adding Cargo.lock
  • [16] RVAH6PXA Getting libpijul to compile to WASM32
  • [17] JTELS6L3 Implement user input for `pijul-interaction`
  • [18] HJVWPKWV Migrate crates to edition 2024
  • [19] PIQCNEEB Upgrading to Clap 3.0.0-alpha.5
  • [20] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [21] IVLLXQ5Z Improved push/pull reporting
  • [22] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [23] FE5ES6Q4 Stop pushing/pulling if the remote returns an error
  • [24] UDHP4ZVB Fixing SSH asynchronicity issues
  • [25] TKEVOH7H Fixing a bug when downloading changes, and making change download more efficient (more async)
  • [26] BNPSVXIC Friendlier progress bars
  • [27] 5QTMRUXN Fixing a race condition between progress bars
  • [28] TCXM4WIJ Remove unused dependencies
  • [29] KVCXCDRM Fixing warnings with Rust 1.57 + cleanup
  • [30] RM225IDQ Exchanging tagged states over SSH
  • [31] KTTKF3RW Locking stderr and the progress bar in SSH
  • [32] AEPEFS7O Write help for each argument
  • [33] DWSAYGVE Update codebase to use new identity management
  • [34] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [35] HWYGVLP5 Replacing the temporary copy of chardetng with the published version
  • [36] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [37] KLBWKCUZ use ssh url syntax like git
  • [38] 5Z2Y7VGV Migrate `pijul::identity::Complete::prove` to `pijul::remote::prove`
  • [39] QQS7LII4 Add value hints to arguments
  • [40] DDJO7X2P Remove dependency on `num_cpus`
  • [41] A3RM526Y Integrating identity malleability
  • [42] YN63NUZO Sanakirja 1.0
  • [43] 2VXTRPO4 Custom diff separators
  • [44] XX6GKS5D Add missing features for migration to `pijul_interaction`
  • [45] SYZ44SKF Remove `async_trait` crate
  • [46] I52XSRUH Massive cleanup, and simplification
  • [47] Q45QHPO4 Feedback on network stuff
  • [48] TA5VXGFG Fixing compilation errors
  • [49] ABPFWGKH Create `pijul-interaction` crate
  • [50] 2MKP7CB7 Move dependencies into workspace `Cargo.toml`
  • [51] 5XMUEZMZ pijul-clone: avoid panics on parsing remote URLs
  • [52] I24UEJQL Various post-fire fixes
  • [53] DO2Y5TY5 Tag synchronisation
  • [*] XR7MNOMU file encoding in updates

Change contents

  • replacement in pijul-remote/src/ssh.rs at line 6
    [6.19][6.25699:25719](),[6.25699][6.25699:25719]()
    use std::sync::Arc;
    [6.19]
    [6.25719]
    use std::sync::{Arc, LazyLock};
  • edit in pijul-remote/src/ssh.rs at line 11
    [6.28][6.126:156](),[6.126][6.126:156]()
    use lazy_static::lazy_static;
  • replacement in pijul-remote/src/ssh.rs at line 34
    [6.26005][6.26005:26064](),[6.26064][6.0:145](),[6.145][6.164:189]()
    lazy_static! {
    static ref ADDRESS: Regex = Regex::new(
    r#"(ssh://)?((?P<user>[^@]+)@)?((?P<host>(\[([^\]]+)\])|([^:/]+)))((:(?P<port>\d+)(?P<path0>(/.+)))|(:(?P<path1>.+))|(?P<path2>(/.+)))"#
    )
    .unwrap();
    [6.26005]
    [6.189]
    static ADDRESS: LazyLock<Regex> = LazyLock::new(|| {
    Regex::new(
    r#"(ssh://)?((?P<user>[^@]+)@)?((?P<host>(\[([^\]]+)\])|([^:/]+)))((:(?P<port>\d+)(?P<path0>(/.+)))|(:(?P<path1>.+))|(?P<path2>(/.+)))"#
    )
    .unwrap()
    });
  • replacement in pijul-remote/src/ssh.rs at line 41
    [6.190][6.190:335]()
    static ref ADDRESS_NOPATH: Regex = Regex::new(
    r#"(ssh://)?((?P<user>[^@]+)@)?((?P<host>(\[([^\]]+)\])|([^:/]+)))(:(?P<port>\d+))?"#
    [6.190]
    [6.26176]
    static ADDRESS_NOPATH: LazyLock<Regex> = LazyLock::new(|| {
    Regex::new(
    r#"(ssh://)?((?P<user>[^@]+)@)?((?P<host>(\[([^\]]+)\])|([^:/]+)))(:(?P<port>\d+))?"#,
  • replacement in pijul-remote/src/ssh.rs at line 45
    [6.26182][6.0:19](),[6.107][6.26197:26199](),[6.26197][6.26197:26199]()
    .unwrap();
    }
    [6.26182]
    [6.26199]
    .unwrap()
    });
  • replacement in pijul-remote/src/lib.rs at line 4
    [6.438][6.10335:10355]()
    use std::sync::Arc;
    [6.438]
    [6.438]
    use std::sync::{Arc, LazyLock};
  • edit in pijul-remote/src/lib.rs at line 7
    [6.29][6.363:393](),[6.245][6.363:393](),[6.903][6.363:393](),[6.439][6.363:393]()
    use lazy_static::lazy_static;
  • replacement in pijul-remote/src/lib.rs at line 9
    [6.26][6.731:839]()
    Base32, ChangeId, ChannelRef, GraphIter, Hash, Merkle, MutTxnT, RemoteRef, TxnT,
    sanakirja::MutTxn,
    [6.26]
    [6.134]
    Base32, ChangeId, ChangePosition, ChannelRef, GraphIter, Hash, Merkle, MutTxnT, Position,
    RemoteRef, TxnT, sanakirja::MutTxn,
  • edit in pijul-remote/src/lib.rs at line 14
    [6.573]
    [6.456]
    use regex::Regex;
  • replacement in pijul-remote/src/lib.rs at line 1602
    [6.78608][6.2910:2996](),[6.2996][6.2358:2522](),[6.2522][6.3137:3249](),[6.3137][6.3137:3249]()
    use libpijul::pristine::{ChangePosition, Position};
    use regex::Regex;
    lazy_static! {
    static ref CHANGELIST_LINE: Regex = Regex::new(
    r#"(?P<num>[0-9]+)\.(?P<hash>[A-Za-z0-9]+)\.(?P<merkle>[A-Za-z0-9]+)(?P<tag>\.)?"#
    )
    .unwrap();
    static ref PATHS_LINE: Regex =
    Regex::new(r#"(?P<hash>[A-Za-z0-9]+)\.(?P<num>[0-9]+)"#).unwrap();
    }
    [6.78608]
    [6.3249]
    static CHANGELIST_LINE: LazyLock<Regex> = LazyLock::new(|| {
    Regex::new(r#"(?P<num>[0-9]+)\.(?P<hash>[A-Za-z0-9]+)\.(?P<merkle>[A-Za-z0-9]+)(?P<tag>\.)?"#)
    .unwrap()
    });
    static PATHS_LINE: LazyLock<Regex> =
    LazyLock::new(|| Regex::new(r#"(?P<hash>[A-Za-z0-9]+)\.(?P<num>[0-9]+)"#).unwrap());
  • edit in pijul-remote/Cargo.toml at line 28
    [6.517][6.517:546]()
    lazy_static.workspace = true
  • replacement in pijul-interaction/src/progress/terminal.rs at line 1
    [3.58][3.59:79]()
    use std::sync::Arc;
    [3.58]
    [3.79]
    use std::sync::{Arc, LazyLock};
  • edit in pijul-interaction/src/progress/terminal.rs at line 6
    [3.210][3.210:240]()
    use lazy_static::lazy_static;
  • replacement in pijul-interaction/src/progress/terminal.rs at line 7
    [3.241][3.241:327]()
    lazy_static! {
    static ref MULTI_PROGRESS: MultiProgress = MultiProgress::new();
    }
    [3.241]
    [3.327]
    static MULTI_PROGRESS: LazyLock<MultiProgress> = LazyLock::new(MultiProgress::new);
  • edit in pijul-interaction/src/input/mod.rs at line 9
    [6.8322][6.8322:8352]()
    use lazy_static::lazy_static;
  • replacement in pijul-interaction/src/input/mod.rs at line 10
    [6.8392][6.8392:8552]()
    lazy_static! {
    static ref THEME: Box<dyn theme::Theme + Send + Sync> = {
    use dialoguer::theme;
    use pijul_config::{self as config, Choice};
    [6.8392]
    [6.8552]
    use pijul_config::{self as config, Choice};
    use std::sync::LazyLock;
  • replacement in pijul-interaction/src/input/mod.rs at line 13
    [6.8553][6.8553:8677]()
    if let Ok((config, _)) = config::Global::load() {
    let color_choice = config.colors.unwrap_or_default();
    [6.8553]
    [6.8677]
    static THEME: LazyLock<Box<dyn theme::Theme + Send + Sync>> = LazyLock::new(|| {
    if let Ok((config, _)) = config::Global::load() {
    let color_choice = config.colors.unwrap_or_default();
  • replacement in pijul-interaction/src/input/mod.rs at line 17
    [6.8678][6.8678:8945]()
    match color_choice {
    Choice::Auto | Choice::Always => Box::<theme::ColorfulTheme>::default(),
    Choice::Never => Box::new(theme::SimpleTheme),
    }
    } else {
    Box::<theme::ColorfulTheme>::default()
    [6.8678]
    [6.8945]
    match color_choice {
    Choice::Auto | Choice::Always => Box::<theme::ColorfulTheme>::default(),
    Choice::Never => Box::new(theme::SimpleTheme),
  • replacement in pijul-interaction/src/input/mod.rs at line 21
    [6.8955][6.8955:8964]()
    };
    }
    [6.8955]
    [6.8964]
    } else {
    Box::<theme::ColorfulTheme>::default()
    }
    });
  • edit in pijul-interaction/Cargo.toml at line 16
    [6.1111][6.1111:1140]()
    lazy_static.workspace = true
  • edit in pijul/src/commands/pushpull.rs at line 4
    [6.1695]
    [6.1695]
    use std::sync::LazyLock;
  • edit in pijul/src/commands/pushpull.rs at line 9
    [6.627][6.1712:1742](),[6.758][6.1712:1742](),[6.1712][6.1712:1742]()
    use lazy_static::lazy_static;
  • replacement in pijul/src/commands/pushpull.rs at line 140
    [6.114348][6.114348:114440]()
    lazy_static! {
    static ref CHANNEL: Regex = Regex::new(r#"([^:]*)(:(.*))?"#).unwrap();
    }
    [6.114348]
    [6.114440]
    static CHANNEL: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"([^:]*)(:(.*))?"#).unwrap());
  • replacement in pijul/src/commands/protocol.rs at line 5
    [6.1913][4.3451:3471]()
    use std::sync::Arc;
    [6.1913]
    [6.1913]
    use std::sync::{Arc, LazyLock};
  • edit in pijul/src/commands/protocol.rs at line 10
    [6.750][6.1931:1961](),[6.1931][6.1931:1961]()
    use lazy_static::lazy_static;
  • replacement in pijul/src/commands/protocol.rs at line 27
    [6.123774][6.123774:123877](),[6.123877][6.15615:15773](),[6.15773][6.123877:123976](),[6.123877][6.123877:123976](),[6.123976][6.11234:11320](),[6.11320][6.124060:124152](),[6.124060][6.124060:124152](),[6.124152][6.32247:32412](),[6.90][6.0:93](),[6.32412][6.0:93](),[6.124152][6.0:93](),[6.93][6.124244:124434](),[6.124244][6.124244:124434]()
    lazy_static! {
    static ref STATE: Regex = Regex::new(r#"state\s+(\S+)(\s+([0-9]+)?)\s+"#).unwrap();
    static ref ID: Regex = Regex::new(r#"id\s+(\S+)\s+"#).unwrap();
    static ref IDENTITIES: Regex = Regex::new(r#"identities(\s+([0-9]+))?\s+"#).unwrap();
    static ref CHANGELIST: Regex = Regex::new(r#"changelist\s+(\S+)\s+([0-9]+)(.*)\s+"#).unwrap();
    static ref CHANGELIST_PATHS: Regex = Regex::new(r#""(((\\")|[^"])+)""#).unwrap();
    static ref CHANGE: Regex = Regex::new(r#"((change)|(partial))\s+([^ ]*)\s+"#).unwrap();
    static ref TAG: Regex = Regex::new(r#"^tag\s+(\S+)\s+"#).unwrap();
    static ref TAGUP: Regex = Regex::new(r#"^tagup\s+(\S+)\s+(\S+)\s+([0-9]+)\s+"#).unwrap();
    static ref APPLY: Regex = Regex::new(r#"apply\s+(\S+)\s+([^ ]*) ([0-9]+)\s+"#).unwrap();
    static ref CHANNEL: Regex = Regex::new(r#"channel\s+(\S+)\s+"#).unwrap();
    static ref ARCHIVE: Regex =
    Regex::new(r#"archive\s+(\S+)\s*(( ([^:]+))*)( :(.*))?\n"#).unwrap();
    }
    [6.123774]
    [6.124434]
    static APPLY: LazyLock<Regex> =
    LazyLock::new(|| Regex::new(r#"apply\s+(\S+)\s+([^ ]*) ([0-9]+)\s+"#).unwrap());
    static ARCHIVE: LazyLock<Regex> =
    LazyLock::new(|| Regex::new(r#"archive\s+(\S+)\s*(( ([^:]+))*)( :(.*))?\n"#).unwrap());
    static CHANGE: LazyLock<Regex> =
    LazyLock::new(|| Regex::new(r#"((change)|(partial))\s+([^ ]*)\s+"#).unwrap());
    static CHANGELIST_PATHS: LazyLock<Regex> =
    LazyLock::new(|| Regex::new(r#""(((\\")|[^"])+)""#).unwrap());
    static CHANGELIST: LazyLock<Regex> =
    LazyLock::new(|| Regex::new(r#"changelist\s+(\S+)\s+([0-9]+)(.*)\s+"#).unwrap());
    static CHANNEL: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"channel\s+(\S+)\s+"#).unwrap());
    static ID: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"id\s+(\S+)\s+"#).unwrap());
    static IDENTITIES: LazyLock<Regex> =
    LazyLock::new(|| Regex::new(r#"identities(\s+([0-9]+))?\s+"#).unwrap());
    static STATE: LazyLock<Regex> =
    LazyLock::new(|| Regex::new(r#"state\s+(\S+)(\s+([0-9]+)?)\s+"#).unwrap());
    static TAG: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"^tag\s+(\S+)\s+"#).unwrap());
    static TAGUP: LazyLock<Regex> =
    LazyLock::new(|| Regex::new(r#"^tagup\s+(\S+)\s+(\S+)\s+([0-9]+)\s+"#).unwrap());
  • edit in pijul/Cargo.toml at line 41
    [6.2884][6.2884:2913]()
    lazy_static.workspace = true
  • replacement in libpijul/src/pristine/mod.rs at line 7
    [6.586940][6.100471:100491]()
    use std::sync::Arc;
    [6.586940]
    [6.586957]
    use std::sync::{Arc, LazyLock};
  • replacement in libpijul/src/pristine/mod.rs at line 57
    [2.234][2.234:620](),[2.620][6.101013:101015](),[6.101013][6.101013:101015]()
    lazy_static! {
    pub(crate) static ref BASE32: data_encoding::Encoding = {
    let mut spec = data_encoding::Specification::new();
    spec.symbols.push_str("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567");
    spec.translate.from = "abcdefghijklmnopqrstuvwxyz".to_string();
    spec.translate.to = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".to_string();
    spec.encoding().unwrap()
    };
    }
    [2.234]
    [6.587267]
    pub(crate) static BASE32: LazyLock<data_encoding::Encoding> = LazyLock::new(|| {
    let mut spec = data_encoding::Specification::new();
    spec.symbols.push_str("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567");
    spec.translate.from = "abcdefghijklmnopqrstuvwxyz".to_string();
    spec.translate.to = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".to_string();
    spec.encoding().unwrap()
    });
  • edit in libpijul/src/lib.rs at line 11
    [6.717566][6.717566:717605]()
    #[macro_use]
    extern crate lazy_static;
  • edit in libpijul/src/lib.rs at line 39
    [6.717926]
    [6.717926]
    use std::sync::{LazyLock, Mutex};
  • replacement in libpijul/src/lib.rs at line 692
    [6.736571][6.736571:736671]()
    use std::sync::Mutex;
    lazy_static! {
    pub static ref TIMERS: Mutex<Timers> = Mutex::new(Timers {
    [6.736571]
    [6.736671]
    pub static TIMERS: LazyLock<Mutex<Timers>> = LazyLock::new(|| {
    Mutex::new(Timers {
  • replacement in libpijul/src/lib.rs at line 705
    [6.737236][6.737236:737246]()
    });
    }
    [6.737236]
    [6.737246]
    })
    });
  • edit in libpijul/src/diff/mod.rs at line 6
    [55.676]
    [55.676]
    use std::sync::LazyLock;
  • replacement in libpijul/src/diff/mod.rs at line 17
    [6.1520][6.1520:1638]()
    lazy_static! {
    pub static ref DEFAULT_SEPARATOR: regex::bytes::Regex = regex::bytes::Regex::new("\n").unwrap();
    }
    [6.1520]
    [6.793458]
    pub static DEFAULT_SEPARATOR: LazyLock<regex::bytes::Regex> =
    LazyLock::new(|| regex::bytes::Regex::new("\n").unwrap());
  • edit in libpijul/Cargo.toml at line 57
    [6.4771][6.4771:4800]()
    lazy_static.workspace = true
  • edit in Cargo.toml at line 65
    [6.6935][6.6935:6955]()
    lazy_static = "1.4"
  • edit in Cargo.lock at line 1387
    [5.5716][6.35616:35638](),[6.35616][6.35616:35638]()
    "lazy_static 1.4.0",
  • edit in Cargo.lock at line 1878
    [6.48372][6.48372:48394]()
    "lazy_static 1.4.0",
  • edit in Cargo.lock at line 1948
    [6.676][6.676:698]()
    "lazy_static 1.4.0",
  • edit in Cargo.lock at line 1973
    [6.3451][6.3451:3473]()
    "lazy_static 1.4.0",