From 8b1a2087e058f94aa899cdabe04f03a39e00d7e5 Mon Sep 17 00:00:00 2001 From: Loi Chyan Date: Wed, 20 Nov 2024 18:06:15 +0800 Subject: [PATCH 1/4] build(nix): refine development environment management --- .editorconfig | 2 ++ .husky/pre-push | 13 +++++++++++++ flake.lock | 26 +++++++++++++------------- flake.nix | 38 ++++++++++++++++++++++---------------- rust-toolchain.toml | 8 ++++++++ 5 files changed, 58 insertions(+), 29 deletions(-) create mode 100644 .editorconfig create mode 100755 .husky/pre-push create mode 100644 rust-toolchain.toml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ef92655 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,2 @@ +[*.sh] +indent_style = tab diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 0000000..0de1941 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euo pipefail +if command -v nix &>/dev/null; then + nix develop .#msrv --command cargo check +fi +if command -v cargo &>/dev/null; then + if command -v cargo-clippy &>/dev/null; then + cargo clippy + else + cargo check + fi + cargo test +fi diff --git a/flake.lock b/flake.lock index 7e22c20..1293b70 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1723012113, - "narHash": "sha256-AJGsmwDnheWMjZWUqgiGtBjbxMmvLvMp5WJhmTRhJ4w=", + "lastModified": 1732084544, + "narHash": "sha256-0p50xdUCAvKWh3s7seOiGN4BaXwPAk852gYvNc13hWc=", "owner": "nix-community", "repo": "fenix", - "rev": "3dab4ada5b0c5a22d56dbfd7e140c16f3df2e69a", + "rev": "6120ce1d29263ed58981e7e223e55942702de853", "type": "github" }, "original": { @@ -26,11 +26,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -41,16 +41,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1722813957, - "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=", + "lastModified": 1731890469, + "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa", + "rev": "5083ec887760adfe12af64830a66807423a859a7", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -65,11 +65,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1722925734, - "narHash": "sha256-5maDP51jkTUCHDU7tKdbsMQTk0QMNZjNGZw2z++YaaI=", + "lastModified": 1732050317, + "narHash": "sha256-G5LUEOC4kvB/Xbkglv0Noi04HnCfryur7dVjzlHkgpI=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "b23142209ef632475915e858f5f20901ef7c12da", + "rev": "c0bbbb3e5d7d1d1d60308c8270bfd5b250032bb4", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bf8d426..db4ba08 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; fenix = { url = "github:nix-community/fenix"; @@ -19,34 +19,37 @@ }; inherit (pkgs) lib mkShell fenix; - # Rust toolchain - crate = (lib.importTOML ./Cargo.toml).package; + toolchainFile = (lib.importTOML ./rust-toolchain.toml); + cargoManifest = (lib.importTOML ./Cargo.toml); + crate = cargoManifest.package; + + # Rust toolchain for development rustChannel = { - channel = crate.rust-version; + channel = toolchainFile.toolchain.channel; sha256 = "sha256-SXRtAuO4IqNOQq+nLbrsDFbVk+3aVA8NNpSZsKlVH/8="; }; rustToolchain = fenix.toolchainOf rustChannel; - - # For development rust-dev = fenix.combine ( with rustToolchain; [ defaultToolchain rust-src - rust-analyzer ] ); - rust-analyzer = rustToolchain.rust-analyzer; - # For building packages - rust-minimal = rustToolchain.minimalToolchain; - rustPlatform = pkgs.makeRustPlatform { - cargo = rust-minimal; - rustc = rust-minimal; - }; + # Rust toolchain of MSRV + rust-msrv = + if crate.rust-version == rustChannel.channel then + # Reuse the development toolchain if possible + rust-dev + else + (fenix.toolchainOf { + channel = crate.rust-version; + sha256 = ""; + }).minimalToolchain; in { - packages.default = rustPlatform.buildRustPackage { + packages.default = pkgs.rustPlatform.buildRustPackage { pname = crate.name; version = crate.version; src = ./.; @@ -67,9 +70,12 @@ devShells.with-rust-analyzer = mkShell { packages = [ rust-dev - rust-analyzer + rustToolchain.rust-analyzer ]; }; + devShells.msrv = mkShell { + packages = [ rust-msrv ]; + }; } ); } diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..6640c9f --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,8 @@ +[toolchain] +# The channel used to develop this crate. +# For binary crates, it should remain the same as the crate's MSRV to ensure all +# tests pass for packaging. +# For library crates, it may differ from the MSRV since many development +# dependencies require a newer version of Rust, while we still aim to support +# older versions. +channel = "1.75" From 32f8db2f6dff745a6ac4cfc26f65c2064c7c078c Mon Sep 17 00:00:00 2001 From: Loi Chyan Date: Wed, 13 Nov 2024 17:26:44 +0800 Subject: [PATCH 2/4] docs: keep a changelog --- CHANGELOG.md | 299 +++++++++++++++++++++++++-------------------------- 1 file changed, 149 insertions(+), 150 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce3c0a5..c1fe387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,219 +1,218 @@ # Changelog -## v0.4.1 (2024-07-14) +All notable changes to this project will be documented in this file. -### ✨ Overview +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project +adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -This release mainly addresses the high memory usage issue reported in #18: fixed a potential memory -leak (#21) and implemented stream processing (#22). + -### 🛠️ Build +## [Unreleased] -- **(nix)** Update flakes -- **(cargo)** Update dependencies +### Added -## v0.4.0 (2023-10-20) +- Add a subcommand, `nerdfix completions `, to generate completions for your shell + ([#30](https://github.com/loichyan/nerdfix/pull/30)). -### Overview +## [0.4.1] - 2024-07-14 -This release primarily introduces the predefined substitutions suggested in -[#9](https://github.com/loichyan/nerdfix/issues/9) (thanks [@Finii](https://github.com/Finii)!) and -also brings a few refactors on the CLI. Here are some guides for migrating from `v0.3`: +This release mainly addresses the high memory usage issue reported in +[#18](https://github.com/loichyan/nerdfix/pull/18): fixed a potential memory leak in +[#21](https://github.com/loichyan/nerdfix/pull/21), and implemented stream processing in +[#22](https://github.com/loichyan/nerdfix/pull/22). -1. Use `dump` instead of `cache` to show all icons and substitutions in the runtime database. -2. Previous release of `nerdfix` supports the `--replace FROM:TO` argument to perform a prefix - substitution, now it defines a new argument `--sub TYPE:FROM/TO` which supports both `exact` and - `prefix` substitutions. This means that you should use `--sub prefix:FROM/TO` in place of the old - one. -3. You can pipe the input/output with `nerdfix` using the special `-` path. - -### Feat +Also, some UI changes were introduced in [#21](https://github.com/loichyan/nerdfix/pull/21), as we +switched the diagnostic reporter from +[codespan_reporting](https://docs.rs/codespan-reporting/latest/codespan_reporting) to +[miette](https://docs.rs/miette/latest/miette). -- **database**: make `prefix:mdi-/md-` a default substitution -- support read from and write to stdio in more options -- **runtime**: generate icon substitutions list for `nf-mdi-*` -- **autofix**: load predefined substitutions list -- **parser**: support new cheat-sheet format -- **parser**: strip `nf-` prefixes -- **cli**: use `-v/-q` to control log level +### Added -### Fix +- Support filter out binary files + ([d1f29e4](https://github.com/loichyan/nerdfix/commit/d1f29e4bdd40b784090486fc7bf798ecd42997fb)). +- Support filter out files by size + ([db421eb](https://github.com/loichyan/nerdfix/commit/db421ebfa941d7ea4e2ce386fef4d576922bbf4a)). -- **runtime**: clear buffer before check sources -- **log**: exit non-zero if any error occurs -- **cli**: warn deprecated arguments -- **justfile**: remove redundant `nf-` prefixes +### Changed -### Refactor +- Report the source paths of diagnostics ([#23](https://github.com/loichyan/nerdfix/pull/23)). +- Process files in bytes stream ([#22](https://github.com/loichyan/nerdfix/pull/22)). +- Use `miette` in place of `codespan-reporting` as the diagnostic reporter + ([#21](https://github.com/loichyan/nerdfix/pull/21)). -- **cli**: rename term input to database -- implement a syntax to define substitutions -- **cli**: use `--input` to load substitutions -- clean up typo and unused codes -- **colored**: replace `colored` with `nu_ansi_term` -- **autofix**: move `--replace` to global options -- **cli**: rename subcommand `cache` to `index` -- **cache**: save in json -- **macros**: match block instead of statements -- **error**: show path in logs -- replace inline closures with try-block macro +### Fixed -## v0.3.1 (2023-05-15) +- Fix subtract with overflow + ([aa29181](https://github.com/loichyan/nerdfix/commit/aa29181aa41c094e60e519b7c61b95adf331f866)). +- Fix potential memory leaks ([#21](https://github.com/loichyan/nerdfix/pull/21)). -### Fix +## [0.4.0] - 2023-10-20 -- **cli**: pad output codepoints +This release introduces the predefined substitutions support suggested in +[#9](https://github.com/loichyan/nerdfix/issues/9) (thanks [@Finii](https://github.com/Finii)), and +also brings some UX breaking changes. Here are some guides for migrating from `v0.3`: -## v0.3.0 (2023-05-12) +1. Use `dump` instead of `cache` to show all icons and substitutions in the runtime database. +2. The Previous release supports use `--replace FROM:TO` to perform a prefix substitution, now it + uses the newly add `--sub TYPE:FROM/TO` argument to support both `exact` and `prefix` + substitutions. This means that you should use `--sub prefix:FROM/TO` in place of the old one. -### Feat +### Added -- **cli**: support optional paths to write content to -- **cli**: support recursive directories traversal (#6) -- **cli**: improve prompts auto confirmation (#4) +- Add `-v/-q` to control log level + ([1294e24](https://github.com/loichyan/nerdfix/commit/1294e24972baaf5e0b88a3021745f2ae6a261e20)). +- Support load predefined substitutions list ([#10](https://github.com/loichyan/nerdfix/pull/10)). +- Support parse the new cheat-sheet format ([#10](https://github.com/loichyan/nerdfix/pull/10)). +- Support read from and write to STDIO in more options + ([#7](https://github.com/loichyan/nerdfix/pull/7)). -### Fix +### Changed -- **parser**: icons with `removed` label should be considered as obsolete +- [**breaking**] Rename subcommand `cache` to `dump` + ([f148638](http://github.com/loichyan/nerdfix/commit/2bbfc04ea356228a92f714a84a23246004320c3f)). +- [**breaking**] Deprecated `--replace FROM:TO`, use `--sub prefix:FROM/TO` instead + ([557c6fd](http://github.com/loichyan/nerdfix/commit/557c6fd1a7173ad6e34e431406577a3adf66ed97)). +- Move `--sub` to global options + ([6c8808e](https://github.com/loichyan/nerdfix/commit/6c8808e61dabaaf1bb91bd079c47862a62eed7ff)). +- Save database in JSON + ([e8a0ccf](https://github.com/loichyan/nerdfix/commit/e8a0ccf2a944a2a25e49251ceaf0158cbd0791df)). +- Show source paths in logs + ([2699dd4](https://github.com/loichyan/nerdfix/commit/2699dd4f4f7d1a1cf540f6afb7e4d38215648400)). +- Strip `nf-` prefixes in messages, and generated databases + ([#12](https://github.com/loichyan/nerdfix/pull/12)). +- Warn usage of deprecated arguments + ([a783b7e](https://github.com/loichyan/nerdfix/commit/a783b7e96b38edfb0e7dda0de1f56d6d9c64100a)). -### Refactor +### Fixed -- **util**: replace some macros with ext traits +- Exit non-zero if any error occurs ([#15](https://github.com/loichyan/nerdfix/pull/15)). -## v0.2.3 (2023-05-03) +## [0.3.1] - 2023-05-14 -### Fix +### Fixed -- **stdio**: logs and diagnostics should be written to different streams +- Fix testing regressions + ([4070f9e](https://github.com/loichyan/nerdfix/commit/4070f9e894337ca7d3f7641258428ad6d7cd6332)). +- Pad output codepoints + ([021d313](https://github.com/loichyan/nerdfix/commit/021d313ab3d1821e5bcf5d0d8d39a7d5fcdec776)). -### Refactor +## [0.3.0] - 2023-05-12 -- `error::Io` can be directly constructed with `&Path` +### Added -## v0.2.2 (2023-05-02) +- Support recursive directories traversal ([#6](https://github.com/loichyan/nerdfix/pull/6)). +- Support specify optional paths where patched contents are written to + ([ee9b398](https://github.com/loichyan/nerdfix/commit/ee9b398268b38ebbec59609f30d6f753ab6ef152)). -### Fix +### Changed -- **fix**: patched content should be created in autofix -- **prompt**: keyboard hints should follow the same style -- **error**: `Error` should display brief message +- [**breaking**] Deprecated `--yes`, use `--write` and `--select-first` to force non-interactive + fixes ([#4](https://github.com/loichyan/nerdfix/pull/4)). +- Streamline Nix package derivation + ([a9a3630](https://github.com/loichyan/nerdfix/commit/a9a3630c6eafe6558fcca49aa964243d0f5b688f)). -### Refactor +### Fixed -- **cli**: show more metadata -- **error**: make path optional -- **error**: derive `From` for source errors +- Do not consider icons with `removed` label as obsolete + ([750ace5](https://github.com/loichyan/nerdfix/commit/750ace506f4c52fd0fa437411102b5be18a3a354)). -## v0.2.1 (2023-04-11) +## [0.2.3] - 2023-05-03 -### Feat +### Added -- **search**: print the icon name +- Add Nix flake package + ([b33907b](https://github.com/loichyan/nerdfix/commit/b33907b0d5b605376377dabd950526eacb3cd5e4)). -### Fix +### Fixed -- **prompt**: display formatted user input -- **search**: use the first string of user input -- **runtime**: sort candidates by their names for stable results +- Write logs and diagnostics to different streams + ([0e7b3f6](https://github.com/loichyan/nerdfix/commit/0e7b3f6389b0a783a2f2838f701f645f69548e2f)). -### Refactor +## [0.2.2] - 2023-05-02 -- **search**: use n-grams to search subset matches -- **runtime**: replace ngrammatic with noodler +### Changed -## v0.2.0 (2023-03-30) +- Display brief error messages + ([8319fcb](https://github.com/loichyan/nerdfix/commit/8319fcbfa4eccb5f7f87d5a4804e5cda51d9393b)). +- Use the same style of keyboard hints + ([e5a8975](https://github.com/loichyan/nerdfix/commit/e5a8975cffbeac417c4b68e56a742941e33f85bd)). -### Feat +### Fixed -- **cli**: support output structured data -- **cli**: use `--verbose` to increase log level -- **cli**: use `fix --replace` to auto fix icons -- **cli**: support send yes to all prompts +- Sync non-patched contents before autofix + ([44ad79d](https://github.com/loichyan/nerdfix/commit/44ad79dd357cd351685f8aea7aa54cab88f1ea32)). -### Fix +## [0.2.1] - 2023-04-11 -- **runtime**: add path in structured output -- **runtime**: log errors and continue running -- **runtime**: dont load inlined icons if user input is present +### Added -### Refactor +- Show the name of a selected icon + ([48d7aff](https://github.com/loichyan/nerdfix/commit/48d7aff8b57fd04312f311d09bb9d2b718e8b461)). -- **iter**: use itertools to simplify code -- **cli**: dont allow short argument for `fix --replace` -- **report**: change the severity of obsolete fonts to NOTE -- **runtime**: lazily construct patched content +### Fixed -### Perf +- Only use the first string of user input + ([f67f157](https://github.com/loichyan/nerdfix/commit/f67f157218e4d4c018fdc8aedb0c21542d9f7de7)). +- Sort candidates by names for stable results + ([1529a4b](https://github.com/loichyan/nerdfix/commit/1529a4b1b186dd2369e5ccf712d4844fd84be5d2)). -- **runtime**: lazily initialize candidates +## [0.2.0] - 2023-03-30 -## v0.1.0 (2023-03-25) +### Added -### Feat +- Support fix sources non-interactively through `--yes` + ([e2e4bc9](https://github.com/loichyan/nerdfix/commit/e2e4bc9c275294ff4f1d97650b26475b80e7af47)). +- Support structured format output through `--format=json` + ([#2](https://github.com/loichyan/nerdfix/pull/2)). +- Add `--replace` to autofix icons by name ([#1](https://github.com/loichyan/nerdfix/pull/1)). +- Add `--verbose` to control log level + ([4830e37](https://github.com/loichyan/nerdfix/commit/4830e3766cc4892b6eefad567da2cc5fb3a4a677)). -- **parser**: parse both cheat sheet and cached content input -- **cli**: add `search` to fuzzy search an icon -- **autocomplete**: search icons whose name contain the input string -- **fix**: show icons in suggesions -- **check**: auto patch using last user input -- **cli**: add `cache`, `check` and `fix` commands +### Changed -### Fix +- Change the severity of obsolete fonts to NOTE + ([2debe0b](https://github.com/loichyan/nerdfix/commit/2debe0b337f5f4c101abd53701ab4fb59e740475)). -- **cli**: dont prompt if no icon is patched -- **cli**: ignore errors in prompt -- **clippy**: fix clippy warnings +### Fixed -### Refactor +- Do not load builtin icons if users specify their own database + ([428b468](https://github.com/loichyan/nerdfix/commit/428b468e92d575740bd283a37719e03924a89bcf)). -- **runtime**: use `IndexMap` to store icons -- **runtime**: move `Runtime` to a standalone module `crate::runtime` -- move some type definitions and implementations to standalone modules -- **icon**: rename `crate::db` to `crate::icon` -- **db**: change type of `Icon::codepoint` to `char` +## [0.1.0] - 2023-03-25 -### Perf +🎉 Initial release. See [README](https://github.com/loichyan/nerdfix/blob/v0.1.0/README.md) for more +details. -- **runtime**: dont clone icons +[Unreleased]: https://github.com/loichyan/nerdfix/compare/v0.4.1..HEAD +[0.4.1]: https://github.com/loichyan/nerdfix/compare/v0.4.0..v0.4.1 +[0.4.0]: https://github.com/loichyan/nerdfix/compare/v0.3.1..v0.4.0 +[0.3.1]: https://github.com/loichyan/nerdfix/compare/v0.3.0..v0.3.1 +[0.3.0]: https://github.com/loichyan/nerdfix/compare/v0.2.3..v0.3.0 +[0.2.3]: https://github.com/loichyan/nerdfix/compare/v0.2.2..v0.2.3 +[0.2.2]: https://github.com/loichyan/nerdfix/compare/v0.2.1..v0.2.2 +[0.2.1]: https://github.com/loichyan/nerdfix/compare/v0.2.0..v0.2.1 +[0.2.0]: https://github.com/loichyan/nerdfix/compare/v0.1.0..v0.2.0 +[0.1.0]: https://github.com/loichyan/nerdfix/releases/tag/v0.1.0 From e84169f25b39e1f94c4a5012fc358b91a8434fdf Mon Sep 17 00:00:00 2001 From: Loi Chyan Date: Wed, 13 Nov 2024 22:00:40 +0800 Subject: [PATCH 3/4] ci: adjust release workflow --- .github/workflows/cicd.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 81656ac..3650896 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -171,6 +171,11 @@ jobs: name: ${{ needs.metadata.outputs.name }}-${{ matrix.target }} path: ${{ steps.pack.outputs.name }}* + # How to create a new GitHub release? + # 1. Create a release branch named "release/". + # 2. Open a PR from the branch, including the release note in the PR body. + # 3. Wait for the CI to create a draft release. + # 4. Publish the release when it's ready. release: name: Create GitHub release needs: [metadata, build] @@ -179,10 +184,6 @@ jobs: contents: write # need to update release runs-on: ubuntu-latest steps: - - name: Setup | Checkout - uses: actions/checkout@v4 - - # For a PR from "release/v1.0.0", the release tag is set to "v1.0.0" - name: Setup | Configure id: configure run: echo tag="${GITHUB_HEAD_REF#release/}" >$GITHUB_OUTPUT @@ -194,24 +195,23 @@ jobs: pattern: ${{ needs.metadata.outputs.name }}-* merge-multiple: true - # Release notes are taken from the PR's body - name: Release | Create Release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} release_tag: ${{ steps.configure.outputs.tag }} release_body: ${{ github.event.pull_request.body }} run: | - if gh release view --json= "$release_tag" &>/dev/null; then - echo "update existed release $release_tag" - command=edit + if gh release view "$release_tag" &>/dev/null; then + echo "update existing release $release_tag" + command="edit" else echo "create new release $release_tag" - command=create + command="create" fi gh release "$command" "$release_tag" \ --target="$GITHUB_BASE_REF" \ --draft=true \ - --title="$release_tag ($(date -u +'%Y-%m-%d'))" \ + --title="${release_tag#v} ($(date -u +'%Y-%m-%d'))" \ --notes="$release_body" - name: Release | Upload artifacts From 8612bd676d86ea10404c422505ba3a00ab1835eb Mon Sep 17 00:00:00 2001 From: Loi Chyan Date: Fri, 22 Nov 2024 14:45:17 +0800 Subject: [PATCH 4/4] refactor: rename `nerdfix::util` to `nerdfix::utils` --- src/main.rs | 4 ++-- src/runtime.rs | 2 +- src/{util.rs => utils.rs} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename src/{util.rs => utils.rs} (100%) diff --git a/src/main.rs b/src/main.rs index 070cba6..9598d71 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ #[macro_use] -mod util; +mod utils; mod autocomplete; mod cli; mod error; @@ -20,7 +20,7 @@ use walkdir::WalkDir; use self::cli::{Command, IoPath, Source}; use self::prompt::YesOrNo; use self::runtime::{CheckerContext, Runtime}; -use self::util::{LogStatus, ResultExt as _}; +use self::utils::{LogStatus, ResultExt as _}; static ICONS: &str = include_str!("./icons.json"); static SUBSTITUTIONS: &str = include_str!("./substitutions.json"); diff --git a/src/runtime.rs b/src/runtime.rs index 2e920a4..17f6f13 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -16,7 +16,7 @@ use crate::autocomplete::Autocompleter; use crate::cli::{IoPath, OutputFormat, UserInput}; use crate::error; use crate::icon::{Database, Icon, Substitution, SubstitutionType, Substitutions}; -use crate::util::NGramSearcherExt as _; +use crate::utils::NGramSearcherExt as _; const ARITY: usize = 3; const PAD_LEN: usize = 2; diff --git a/src/util.rs b/src/utils.rs similarity index 100% rename from src/util.rs rename to src/utils.rs