├── .dir-locals.el ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ └── test.yml ├── .gitignore ├── CHANGELOG.org ├── Eask ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── img ├── auto_import.png ├── cargo_current_test.png ├── code_actions.png ├── compilation_buffer.png ├── macro_expansion.png ├── outdated.png ├── popup.png ├── popup_help.png ├── rustc_errno.png ├── rustic-doc.png └── xref_references.png ├── justfile ├── rustic-babel.el ├── rustic-cargo.el ├── rustic-clippy.el ├── rustic-comint.el ├── rustic-compile.el ├── rustic-doc.el ├── rustic-doc ├── Makefile ├── README.org ├── convert.sh ├── debug_files │ ├── README.md │ ├── constant.ARCH.html │ ├── enum.Option.html │ ├── enum.Option_files │ │ ├── ayu1.57.0.css │ │ ├── brush1.57.0.svg │ │ ├── clipboard1.57.0.svg │ │ ├── crates1.57.0.js │ │ ├── dark1.57.0.css │ │ ├── light1.57.0.css │ │ ├── main1.57.0.js │ │ ├── normalize1.57.0.css │ │ ├── rust-logo1.57.0.png │ │ ├── rustdoc1.57.0.css │ │ ├── sidebar-items.js │ │ ├── storage1.57.0.js │ │ └── wheel1.57.0.svg │ ├── option.html │ ├── primitive.i16.html │ ├── primitive.i16_files │ │ ├── ayu1.57.0.css │ │ ├── brush1.57.0.svg │ │ ├── clipboard1.57.0.svg │ │ ├── crates1.57.0.js │ │ ├── dark1.57.0.css │ │ ├── light1.57.0.css │ │ ├── main1.57.0.js │ │ ├── normalize1.57.0.css │ │ ├── rust-logo1.57.0.png │ │ ├── rustdoc1.57.0.css │ │ ├── sidebar-items.js │ │ ├── storage1.57.0.js │ │ └── wheel1.57.0.svg │ ├── shared.rs.html │ ├── trait.AsRef.html │ └── trait.AsRef_files │ │ ├── ayu1.57.0.css │ │ ├── brush1.57.0.svg │ │ ├── clipboard1.57.0.svg │ │ ├── crates1.57.0.js │ │ ├── dark1.57.0.css │ │ ├── light1.57.0.css │ │ ├── main1.57.0.js │ │ ├── normalize1.57.0.css │ │ ├── rust-logo1.57.0.png │ │ ├── rustdoc1.57.0.css │ │ ├── sidebar-items.js │ │ ├── storage1.57.0.js │ │ ├── trait.AsRef.js │ │ └── wheel1.57.0.svg └── filter.lua ├── rustic-expand.el ├── rustic-flycheck.el ├── rustic-interaction.el ├── rustic-lsp.el ├── rustic-playground.el ├── rustic-popup.el ├── rustic-rustfix.el ├── rustic-rustfmt.el ├── rustic-spellcheck.el ├── rustic.el └── test ├── all-tests.el ├── rustic-babel-test.el ├── rustic-cargo-test.el ├── rustic-clippy-test.el ├── rustic-compilation-error-tests.el ├── rustic-compile-test.el ├── rustic-doc-test.el ├── rustic-format-test.el ├── rustic-lsp-mode-test.el ├── rustic-window-test.el ├── rustic-workspace-test.el ├── test-helper.el ├── test-project-single-crate ├── Cargo.lock ├── Cargo.toml └── crates │ └── test-crate │ ├── Cargo.toml │ └── src │ ├── lib.rs │ └── main.rs └── test-project ├── Cargo.lock ├── Cargo.toml └── crates ├── another-test-crate ├── Cargo.toml └── src │ └── lib.rs ├── bar ├── Cargo.toml └── src │ └── lib.rs ├── depend-on-test-crate ├── Cargo.toml └── src │ └── lib.rs ├── foo ├── Cargo.toml └── src │ └── lib.rs └── test-crate ├── Cargo.toml └── src ├── lib.rs └── main.rs /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((emacs-lisp-mode 2 | (indent-tabs-mode . nil)) 3 | (makefile-gmake-mode 4 | (outline-regexp . "##"))) 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * linguist-vendored 2 | *.el linguist-vendored=false 3 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: monthly 7 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | workflow_dispatch: 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.ref }} 11 | cancel-in-progress: true 12 | 13 | jobs: 14 | test: 15 | runs-on: ${{ matrix.os }} 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | os: 20 | - ubuntu-latest 21 | # TODO: Test other OSs! 22 | #- macos-latest 23 | #- windows-latest 24 | emacs-version: 25 | - 28.2 26 | - 29.4 27 | - 30.1 28 | 29 | steps: 30 | - uses: actions/checkout@v4 31 | 32 | - uses: taiki-e/install-action@v2 33 | with: 34 | tool: just@1.16.0 35 | 36 | - uses: jcs090218/setup-emacs@master 37 | with: 38 | version: ${{ matrix.emacs-version }} 39 | 40 | - uses: emacs-eask/setup-eask@master 41 | with: 42 | version: 'snapshot' 43 | 44 | - name: Install requirements 45 | run: | 46 | echo "$HOME/.eask/bin" >> $GITHUB_PATH 47 | echo "$HOME/bin" >> $GITHUB_PATH 48 | 49 | - uses: dtolnay/rust-toolchain@master 50 | with: 51 | toolchain: 1.80.1 52 | components: clippy, rustfmt 53 | 54 | - name: Run tests 55 | run: | 56 | just build 57 | just test 58 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.elc 2 | /.cask 3 | /.eask 4 | /dist 5 | /config.mk 6 | *autoloads.el 7 | test/test-project/target 8 | test/test-project-single-crate/target -------------------------------------------------------------------------------- /CHANGELOG.org: -------------------------------------------------------------------------------- 1 | * Unreleased 2 | 3 | - Implement ~rustic-cargo-populate-package-name~ customization 4 | option. This is handy when you are working on multiple 5 | projects. Refer the variable docs and README for more details. 6 | - Replace Cask with Eask for CI testing. 7 | - Implement ~rustic-cargo-nextest-current-test~ for running test at a 8 | point using nextest. 9 | - Fixed an issue where workspaces were not resolved correctly over TRAMP. 10 | - Implement ~rustic-cargo-test-rerun-current~ for rerunning the 11 | current test from the compile buffer. 12 | - Provde integration with [[https://nexte.st/][cargo nextest]] 13 | 14 | * 3.5 15 | 16 | - Revamp testing in CI: Use only cask. 17 | - Replace Makefile with justfile. 18 | - Pin Rust version in CI to avoid spurious failure. 19 | - Create a new babel variable to create temporary directory and not 20 | rely on babel's internal stuff. This was needed to fix the tests. 21 | - Fix flaky tests. 22 | - Enable tests for Emacs 29.1 23 | - Update rustc to 1.76.0 24 | - Fix bugs in rustic-cargo-outdated mode in the presence of git 25 | repositories as dependency. 26 | - Remove racer integrace since it's development has been discontinued. 27 | - Enable tests for Emacs 29.2 28 | - Add fixes for enabling tree sitter support from rust-mode. 29 | - Make ~rustic-cargo-clippy~ remember it's universal arguments. 30 | - Populate minibuffer entries for ~rustic-cargo-clippy~ and 31 | ~rustic-cargo-build~ with it's previous entry. 32 | - Fix integration with lsp-mode during format of buffers. 33 | - Make ~rustic-cargo-test~ rembmer it's universal arguments. 34 | - ~rustic-recompile~ will remember any universal arguments that is 35 | passed to it. 36 | - Fix ~rustic-cargo-upgrade~ in the presence of universal arguments. 37 | - Fix ~rustic-cargo-clippy-rerun~ to use the last used arguments. 38 | - Implement ~rustic-babel-display-error-popup~ customization 39 | option. Refer the variable docs for more details. 40 | -------------------------------------------------------------------------------- /Eask: -------------------------------------------------------------------------------- 1 | ;; -*- mode: eask; lexical-binding: t -*- 2 | 3 | (package "rustic" 4 | "3.5" 5 | "Rust development environment") 6 | 7 | (package-file "rustic.el") 8 | 9 | (files "rustic-*.el") 10 | 11 | (source 'gnu) 12 | (source 'melpa) 13 | 14 | (depends-on "rust-mode" "1.0.6") 15 | (depends-on "dash") 16 | (depends-on "f") 17 | (depends-on "markdown-mode") 18 | (depends-on "s") 19 | (depends-on "spinner") 20 | (depends-on "xterm-color") 21 | (depends-on "flycheck") 22 | (depends-on "project" "0.3.0") 23 | 24 | (development 25 | (depends-on "ert-runner") 26 | (depends-on "lsp-mode")) 27 | 28 | (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 29 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 The Rust Project Developers 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /img/auto_import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/auto_import.png -------------------------------------------------------------------------------- /img/cargo_current_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/cargo_current_test.png -------------------------------------------------------------------------------- /img/code_actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/code_actions.png -------------------------------------------------------------------------------- /img/compilation_buffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/compilation_buffer.png -------------------------------------------------------------------------------- /img/macro_expansion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/macro_expansion.png -------------------------------------------------------------------------------- /img/outdated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/outdated.png -------------------------------------------------------------------------------- /img/popup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/popup.png -------------------------------------------------------------------------------- /img/popup_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/popup_help.png -------------------------------------------------------------------------------- /img/rustc_errno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/rustc_errno.png -------------------------------------------------------------------------------- /img/rustic-doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/rustic-doc.png -------------------------------------------------------------------------------- /img/xref_references.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/img/xref_references.png -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | # List all recipes 2 | just: 3 | just --list --unsorted 4 | 5 | # Install dependencies and build via eask 6 | build: 7 | emacs --version 8 | eask install-deps --dev 9 | eask package 10 | 11 | # Test 12 | test: 13 | eask compile 14 | eask emacs --batch -L . -L test -l test/all-tests.el -f ert-run-tests-batch-and-exit 15 | 16 | test-one TEST_NAME: 17 | eask compile 18 | eask emacs --batch -L . -L test -l test/all-tests.el -eval '(ert-run-tests-batch-and-exit "{{TEST_NAME}}")' 19 | -------------------------------------------------------------------------------- /rustic-clippy.el: -------------------------------------------------------------------------------- 1 | ;;; rustic-clippy.el --- clippy commands -*-lexical-binding: t-*- 2 | ;;; Commentary: 3 | 4 | ;; This library implements support for `clippy'. 5 | 6 | ;;; Code: 7 | (require 'rustic-cargo) 8 | (require 'rustic-compile) 9 | 10 | (defcustom rustic-cargo-clippy-fix-args "--allow-dirty" 11 | "Default arguments when running `clippy --fix'." 12 | :type 'string 13 | :group 'rustic-cargo) 14 | 15 | (defcustom rustic-default-clippy-arguments "--all-targets --all-features" 16 | "Default arguments when running `clippy'." 17 | :type 'string 18 | :group 'rustic-cargo) 19 | 20 | (defcustom rustic-lints-arguments "-f custom_lints.toml clippy" 21 | "Default arguments when running `cargo-lints'." 22 | :type 'string 23 | :group 'rustic-cargo) 24 | 25 | (defvar rustic-clippy-process-name "rustic-cargo-clippy-process" 26 | "Process name for clippy processes.") 27 | 28 | (defvar rustic-clippy-buffer-name "*cargo-clippy*" 29 | "Buffer name for clippy buffers.") 30 | 31 | (defvar rustic-clippy-arguments "" 32 | "Holds arguments for `cargo clippy', similar to `compilation-arguments`.") 33 | 34 | (defvar rustic-cargo-clippy-mode-map 35 | (let ((map (make-sparse-keymap))) 36 | (define-key map [remap recompile] 'rustic-cargo-clippy-rerun) 37 | map) 38 | "Local keymap for `rustic-cargo-clippy-mode' buffers.") 39 | 40 | (define-derived-mode rustic-cargo-clippy-mode rustic-compilation-mode "cargo-clippy" 41 | :group 'rustic) 42 | 43 | ;;;###autoload 44 | (defun rustic-cargo-clippy-run (&rest args) 45 | "Run `cargo clippy' with optional ARGS." 46 | (interactive) 47 | (let* ((command (list rustic-cargo-bin "clippy")) 48 | (params (plist-get args :params)) 49 | (c (append command (split-string (if params params "")))) 50 | (buf rustic-clippy-buffer-name) 51 | (proc rustic-clippy-process-name) 52 | (mode 'rustic-cargo-clippy-mode)) 53 | (unless (plist-get args :no-save) 54 | (rustic-compilation-process-live)) 55 | (rustic-compilation c (list :buffer buf 56 | :process proc 57 | :mode mode 58 | :sentinel (plist-get args :sentinel) 59 | :no-display (plist-get args :silent))))) 60 | 61 | ;;;###autoload 62 | (defun rustic-cargo-lints () 63 | "Run `cargo-lints' with optional ARGS." 64 | (interactive) 65 | (let* ((command `(,(rustic-cargo-bin) 66 | "lints" 67 | ,@(split-string rustic-lints-arguments))) 68 | (buf rustic-clippy-buffer-name) 69 | (proc rustic-clippy-process-name) 70 | (mode 'rustic-cargo-clippy-mode)) 71 | (rustic-compilation command (list :buffer buf :process proc :mode mode)))) 72 | 73 | ;;;###autoload 74 | (defun rustic-cargo-clippy (&optional arg) 75 | "Run `cargo clippy'. 76 | 77 | If ARG is not nil, use value as argument and store it in `rustic-clippy-arguments'. 78 | When calling this function from `rustic-popup-mode', always use the value of 79 | `rustic-clippy-arguments'." 80 | (interactive "P") 81 | (rustic-cargo-clippy-run 82 | :params (cond (arg 83 | (setq rustic-clippy-arguments 84 | (read-from-minibuffer "Cargo clippy arguments: " 85 | (rustic--populate-minibuffer 86 | (list 87 | (rustic-cargo-package-argument) 88 | rustic-clippy-arguments 89 | rustic-cargo-build-arguments 90 | rustic-default-clippy-arguments 91 | ))))) 92 | (t 93 | (if (> (length rustic-clippy-arguments) 0) 94 | rustic-clippy-arguments 95 | rustic-default-clippy-arguments) 96 | )))) 97 | 98 | ;;;###autoload 99 | (defun rustic-cargo-clippy-rerun () 100 | "Run `cargo clippy' with `rustic-clippy-arguments'." 101 | (interactive) 102 | (rustic-cargo-clippy-run :params rustic-clippy-arguments)) 103 | 104 | (defun rustic-cargo-clippy-fix (&rest args) 105 | "Run `clippy fix'." 106 | (interactive) 107 | (rustic-cargo-clippy-run 108 | :params (concat "--fix " 109 | rustic-cargo-clippy-fix-args " " 110 | rustic-default-clippy-arguments) 111 | :no-save (plist-get args :no-save) 112 | :silent t 113 | :sentinel (lambda (proc msg) 114 | (while (eq (process-status proc) 'run) 115 | (sit-for 0.1)) 116 | (if (zerop (process-exit-status proc)) 117 | (kill-buffer (get-buffer rustic-clippy-buffer-name)) 118 | (funcall rustic-compile-display-method (process-buffer proc)))))) 119 | 120 | (provide 'rustic-clippy) 121 | ;;; rustic-clippy.el ends here 122 | -------------------------------------------------------------------------------- /rustic-comint.el: -------------------------------------------------------------------------------- 1 | ;;; rustic-comint.el --- Cargo and comint facilities -*-lexical-binding: t-*- 2 | ;;; Commentary: 3 | 4 | ;; This implements various functionalities related to cargo run and 5 | ;; comint interaction. 6 | 7 | ;;; Code: 8 | 9 | (require 'comint) 10 | 11 | (require 'rustic-cargo) 12 | (require 'rustic-compile) 13 | 14 | ;;; Customization 15 | 16 | (defcustom rustic-cargo-run-use-comint nil 17 | "If t then interact with programs in `rustic-cargo-run' using 18 | comint-mode. This creates a dependency on the polymode package. 19 | No special configuration of polymode is needed for this to work, 20 | but you need to install polymode separately." 21 | :type 'boolean 22 | :group 'rustic-cargo) 23 | 24 | ;;; Run with comint 25 | 26 | (defvar rustic-run-comint-process-name "rustic-cargo-run-comint-process" 27 | "Process name for run-comint processes.") 28 | 29 | (defvar rustic-run-comint-buffer-name "*cargo-run-comint*" 30 | "Buffer name for run-comint buffers.") 31 | 32 | (defvar rustic-run-comint-arguments "" 33 | "Holds arguments for `cargo run-comint', similar to `compilation-arguments'.") 34 | 35 | (defvar rustic-cargo-run-comint-mode-map 36 | (let ((map (make-sparse-keymap))) 37 | (define-key map (kbd "C-c C-g") 'rustic-cargo-comint-run-rerun) 38 | map) 39 | "Local keymap for `rustic-cargo-comint-mode' buffers.") 40 | 41 | (define-derived-mode rustic-cargo-run-comint-mode comint-mode "Cargo comint" 42 | "Mode for `cargo run' that derives from `comint-mode'. 43 | 44 | To send input to the compiled program, just type in a string and 45 | hit RET to send it to the program." 46 | (buffer-disable-undo) 47 | (setq buffer-read-only nil)) 48 | 49 | ;;;###autoload 50 | (defun rustic-cargo-comint-run (&optional arg) 51 | "Run `cargo run' but for interactive programs. 52 | 53 | If ARG is not nil, use value as argument and store it in `rustic-run-arguments'. 54 | When calling this function from `rustic-popup-mode', always use the value of 55 | `rustic-run-arguments'." 56 | (interactive "P") 57 | (rustic--inheritenv 58 | (let ((run-args (rustic--get-run-arguments))) 59 | (pop-to-buffer-same-window 60 | (get-buffer-create rustic-run-comint-buffer-name)) 61 | (unless (comint-check-proc (current-buffer)) 62 | (rustic--cargo-repl-in-buffer 63 | (current-buffer) 64 | (concat "run" (cond 65 | (arg 66 | (setq rustic-run-comint-arguments 67 | (read-from-minibuffer "Cargo run arguments: " rustic-run-comint-arguments))) 68 | (run-args) 69 | (t "")))) 70 | (rustic-cargo-run-comint-mode))))) 71 | 72 | ;;;###autoload 73 | (defun rustic-cargo-comint-run-rerun () 74 | "Run `cargo run' with `rustic-run-comint-arguments'." 75 | (interactive) 76 | (rustic--inheritenv 77 | (pop-to-buffer-same-window 78 | (get-buffer-create rustic-run-comint-buffer-name)) 79 | (rustic--cargo-repl-in-buffer 80 | (current-buffer) 81 | (concat "run" rustic-run-comint-arguments)))) 82 | 83 | (defun rustic--cargo-repl-in-buffer (buffer run-args) 84 | "Make Cargo comint Repl in BUFFER. 85 | Optionally accepts RUN-ARGS which will be passed to the 86 | executable." 87 | (make-comint-in-buffer 88 | rustic-run-comint-buffer-name 89 | buffer 90 | (rustic-cargo-bin) 91 | '() 92 | run-args)) 93 | 94 | ;;; Cargo run with plain comint and optional polymode 95 | 96 | (defun rustic-cargo-plainrun-mode () 97 | (interactive) 98 | (if rustic-cargo-run-use-comint 99 | ;; rustic-cargo-comint-run-mode toggles the mode; we want to 100 | ;; always enable. 101 | (unless (and (boundp 'polymode-mode) 102 | polymode-mode 103 | (memq major-mode '(rustic-cargo-plain-run-mode 104 | comint-mode))) 105 | (rustic-cargo-comint-run-mode)) 106 | (rustic-cargo-plain-run-mode))) 107 | 108 | ;;;###autoload 109 | (defun rustic-cargo-plain-run (&optional arg) 110 | "Run `cargo run' for the current project. 111 | Read the full command from the minibuffer when ARG is non-nil or 112 | when called with a prefix command \\[universal-argument]." 113 | (interactive "P") 114 | (let* ((command (if arg 115 | (read-from-minibuffer "Cargo run command: " 116 | (concat (rustic-cargo-bin) " run -- ")) 117 | (concat (rustic-cargo-bin) " run " 118 | (setq rustic-run-arguments 119 | (read-from-minibuffer 120 | "Run arguments: " 121 | (if (rustic-cargo-run-get-relative-example-name) 122 | (concat "--example " 123 | (rustic-cargo-run-get-relative-example-name)) 124 | (car compile-history)) 125 | nil nil 'compile-history)) )))) 126 | (rustic-run-cargo-command command (list :mode 'rustic-cargo-plainrun-mode)))) 127 | 128 | (define-derived-mode rustic-cargo-plain-run-mode rustic-compilation-mode "Cargo run" 129 | "Mode for `cargo run' that derives from `rustic-compilation-mode'. 130 | To send input to the compiled program, use 131 | `rustic-compile-send-input'. If you set 132 | `rustic-cargo-run-use-comint' to t, you can also just type in a 133 | string and hit RET to send it to the program. The latter 134 | approach requires installing polymode." 135 | (buffer-disable-undo) 136 | (setq buffer-read-only nil) 137 | (use-local-map comint-mode-map)) 138 | 139 | (defun rustic-cargo-comint-run-mode () 140 | "Mode for `cargo run' that combines `rustic-compilation-mode' with `comint-mode'. 141 | The former for highlighting and interacting with compiler errors, 142 | and the latter for interacting with the compiled program." 143 | ;; First time around, define the mode and invoke it. Next time, the 144 | ;; symbol will have been overwritten so this runs only once. 145 | (unless (require 'polymode nil 'noerr) 146 | (error "polymode not found; polymode must be installed for `rustic-cargo-run-use-comint' to work")) 147 | (let ((docstr (documentation 'rustic-cargo-comint-run-mode))) 148 | (define-hostmode poly-rustic-cargo-compilation-hostmode 149 | :mode 'rustic-cargo-plain-run-mode) 150 | (define-innermode poly-rustic-cargo-comint-innermode 151 | :mode 'comint-mode 152 | :head-matcher "^ *Running `.+`$" 153 | :head-mode 'host 154 | :tail-matcher "\\'" 155 | :tail-mode 'host) 156 | (define-polymode rustic-cargo-comint-run-mode 157 | :hostmode 'poly-rustic-cargo-compilation-hostmode 158 | :innermodes '(poly-rustic-cargo-comint-innermode) 159 | :switch-buffer-functions '(poly-rustic-cargo-comint-switch-buffer-hook) 160 | 161 | ;; See comments in poly-rustic-cargo-comint-switch-buffer-hook below. 162 | (set (make-local-variable 'pm-hide-implementation-buffers) nil) 163 | ) 164 | (put 'rustic-cargo-comint-run-mode 'function-documentation docstr) 165 | (rustic-cargo-comint-run-mode))) 166 | 167 | (defun poly-rustic-cargo-comint-switch-buffer-hook (old-buffer new-buffer) 168 | "Housekeeping for `rustic-cargo-comint-run-mode'." 169 | ;; Keep inferior process attached to the visible buffer. 170 | (let ((proc (get-buffer-process old-buffer))) 171 | (when proc 172 | (set-process-buffer proc new-buffer))) 173 | ;; Prevent polymode from constantly renaming the 174 | ;; "*rustic-compilation*" buffer. A note in case this undocumented 175 | ;; variable stops working: if that happens, you'll see 176 | ;; *rustic-compilatin*[comint]<2>, <3>, etc. keep popping up. 177 | (set (make-local-variable 'pm-hide-implementation-buffers) nil)) 178 | 179 | (provide 'rustic-comint) 180 | ;;; rustic-comint.el ends here 181 | -------------------------------------------------------------------------------- /rustic-doc/Makefile: -------------------------------------------------------------------------------- 1 | # Used for development 2 | standard: 3 | cd debug_files ;\ 4 | pandoc enum.Option.html --lua-filter ../filter.lua -t native -o filterednative ;\ 5 | pandoc -f native filterednative -o option.org 6 | 7 | standard_unfiltered: 8 | cd debug_files ;\ 9 | pandoc enum.Option.html -t native -o filterednative ;\ 10 | pandoc -f native filterednative -o option.org 11 | 12 | 13 | primitive: 14 | cd debug_files ;\ 15 | pandoc primitive.i16.html --lua-filter ../filter.lua -t native -o filterednative ;\ 16 | pandoc -f native filterednative -o primitive.i16.org 17 | 18 | 19 | primitive_unfiltered: 20 | cd debug_files ;\ 21 | pandoc primitive.i16.html -t native -o filterednative ;\ 22 | pandoc -f native filterednative -o primitive.i16.org 23 | 24 | trait: 25 | cd debug_files ;\ 26 | pandoc trait.AsRef.html --lua-filter ../filter.lua -t native -o filterednative ;\ 27 | pandoc -f native filterednative -o AsRef.org 28 | 29 | code: 30 | cd debug_files ;\ 31 | pandoc shared.rs.html --lua-filter ../filter.lua -t native -o filterednative ;\ 32 | pandoc -f native filterednative -o shared.rs.org 33 | 34 | constant: 35 | cd debug_files ;\ 36 | pandoc constant.ARCH.html --lua-filter ../filter.lua -t native -o filterednative ;\ 37 | pandoc -f native filterednative -o constant.arch.org 38 | 39 | overwrite_filter: 40 | rm ~/.local/bin/rustic-doc-filter.lua 41 | cp ./filter.lua ~/.local/bin/rustic-doc-filter.lua 42 | -------------------------------------------------------------------------------- /rustic-doc/README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Readme 2 | The way I develop the filter is: 3 | 1. Select an html-file to focus on, such as [[./debug_files/enum.Option.html]]. 4 | 2. Open [[./filter.lua]]. 5 | 3. Open [[./debug_files/option.org]]. 6 | 4. Open [[./debug_files/filterednative]]. 7 | 5. Running `make` will now update =option.org= with the org-representation and =filterednative= with the pandoc representation. If anything looks weird in the org-version, more details can be found in filterednative. 8 | 6. See [[./Makefile]] for the alternatives. =make standard= uses the default, whereas =make primitive= uses HTML for the type =i16=, which is formatted differently since it is a primitive. 9 | -------------------------------------------------------------------------------- /rustic-doc/convert.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | LUA_FILTER="$HOME/.local/bin/rustic-doc-filter.lua" 4 | function get_toolchain { 5 | rustup show | sed -nr 's/(.*) \(default\)/\1/p' | head -n 1 6 | } 7 | 8 | if [ "$1" = "" ] || [ "$1" = "--help" ]; then 9 | MY_NAME="$(basename "$0")" 10 | echo "Usage:" 11 | echo " $MY_NAME " 12 | echo " $MY_NAME " 13 | exit 0 14 | fi 15 | 16 | DOC_PATH="$1" 17 | DEST_DIR="$2" 18 | 19 | if [ "$DEST_DIR" = "" ]; then 20 | LIBRARY="$1" 21 | TARGET="$(get_toolchain)" 22 | 23 | ## Users can change the location of the rustup directory 24 | RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}" 25 | ## Set 26 | DOC_PATH="$RUSTUP_HOME/toolchains/$TARGET/share/doc/rust/html/$LIBRARY" 27 | DEST_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/emacs/rustic-doc/$LIBRARY" 28 | 29 | echo "Generating org files in: $DEST_DIR" 30 | fi 31 | 32 | echo "destination dir: $DEST_DIR" 33 | mkdir -p "$DEST_DIR" || exit 1 34 | cd "$DOC_PATH" || exit 1 35 | 36 | ## Copy directory structure 37 | fd . -td -x mkdir -p "$DEST_DIR/{}" 38 | 39 | ## Find redirect files (removes $DOC_PATH prefix) 40 | ignore_file="$(mktemp)" 41 | rg -l "

Redirecting to "$ignore_file" 49 | 50 | if [[ "$OSTYPE" == "darwin"* ]]; then 51 | cores=$(eval "sysctl -n hw.logicalcpu") 52 | else 53 | cores=$(nproc) 54 | fi 55 | ## Convert files 56 | fd . \ 57 | -ehtml \ 58 | --ignore-file "$ignore_file" \ 59 | -j"$cores" \ 60 | -x pandoc '{}' \ 61 | --lua-filter "$LUA_FILTER" \ 62 | -o "$DEST_DIR/{.}.org" 63 | -------------------------------------------------------------------------------- /rustic-doc/debug_files/README.md: -------------------------------------------------------------------------------- 1 | These files are here for developing the filter. 2 | When I develop, I have three files open: `filter.lua`, whatever org-file I am trying to get right (like `debug_files/option.org`), and `debug_files/filterednative` so that I can inspect the 3 | document structure. I then use make to update `filterednative` and the output as I am working on the filter. -------------------------------------------------------------------------------- /rustic-doc/debug_files/constant.ARCH.html: -------------------------------------------------------------------------------- 1 | std::env::consts::ARCH - Rust

1.0.0[][src]Constant std::env::consts::ARCH

pub const ARCH: &str;

A string describing the architecture of the CPU that is currently 2 | in use.

3 |

Some possible values:

4 |
    5 |
  • x86
  • 6 |
  • x86_64
  • 7 |
  • arm
  • 8 |
  • aarch64
  • 9 |
  • mips
  • 10 |
  • mips64
  • 11 |
  • powerpc
  • 12 |
  • powerpc64
  • 13 |
  • riscv64
  • 14 |
  • s390x
  • 15 |
  • sparc64
  • 16 |
17 |
-------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/ayu1.57.0.css: -------------------------------------------------------------------------------- 1 | body{background-color:#0f1419;color:#c5c5c5;}h1,h2,h3,h4{color:white;}h1.fqn{border-bottom-color:#5c6773;}h1.fqn a{color:#fff;}h2,h3,h4{border-bottom-color:#5c6773;}h4{border:none;}.in-band{background-color:#0f1419;}.invisible{background:rgba(0,0,0,0);}.docblock code{color:#ffb454;}.code-header{color:#e6e1cf;}.docblock pre>code,pre>code{color:#e6e1cf;}span code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}.docblock code,.docblock-short code{background-color:#191f26;}pre,.rustdoc.source .example-wrap{color:#e6e1cf;background-color:#191f26;}.sidebar{background-color:#14191f;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}*{scrollbar-color:#5c6773 transparent;}.sidebar{scrollbar-color:#5c6773 transparent;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar::-webkit-scrollbar-track{background-color:transparent;}.sidebar::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar .current{background-color:transparent;color:#ffb44c;}.source .sidebar{background-color:#0f1419;}.sidebar .location{border-color:#000;background-color:#0f1419;color:#fff;}.sidebar-elems .location{color:#ff7733;}.sidebar-elems .location a{color:#fff;}.sidebar .version{border-bottom-color:#424c57;}.sidebar-title{border-top-color:#5c6773;border-bottom-color:#5c6773;}.block a:hover{background:transparent;color:#ffb44c;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#5c6773;}.docblock table td,.docblock table th{border-color:#5c6773;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#c5c5c5;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#000 !important;background-color:#c6afb3;}.search-results a{color:#0096cf;}.search-results a div.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.content span.foreigntype,.content a.foreigntype{color:#ef57ff;}.content span.union,.content a.union{color:#98a01c;}.content span.constant,.content a.constant,.content span.static,.content a.static{color:#6380a0;}.content span.primitive,.content a.primitive{color:#32889b;}.content span.traitalias,.content a.traitalias{color:#57d399;}.content span.keyword,.content a.keyword{color:#de5249;}.content span.externcrate,.content span.mod,.content a.mod{color:#acccf9;}.content span.struct,.content a.struct{color:#ffa0a5;}.content span.enum,.content a.enum{color:#99e0c9;}.content span.trait,.content a.trait{color:#39AFD7;}.content span.type,.content a.type{color:#cfbcf5;}.content span.fn,.content a.fn,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod,.content .fnname{color:#fdd687;}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:#a37acc;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}nav:not(.sidebar){border-bottom-color:#424c57;}nav.main .current{border-top-color:#5c6773;border-bottom-color:#5c6773;}nav.main .separator{border:1px solid #5c6773;}a{color:#c5c5c5;}body.source .example-wrap pre.rust a{background:#333;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#39AFD7;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search{color:#c5c5c5;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;border-color:#424c57;}.search-input{color:#ffffff;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;transition:box-shadow 150ms ease-in-out;}#crate-search+.search-input:focus{box-shadow:0 0 0 1px #148099,0 0 0 2px transparent;}.search-input:disabled{background-color:#3e3e3e;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable,.stab.deprecated,.stab.portability{color:#c5c5c5;background:#314559 !important;border-style:none !important;border-radius:4px;padding:3px 6px 3px 6px;}.stab.portability>code{color:#e6e1cf;background:none;}#help>div{background:#14191f;box-shadow:0px 6px 20px 0px black;border:none;border-radius:4px;}#help span.bottom,#help span.top{border-color:#5c6773;}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .op,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}pre.rust .attribute .ident,pre.rust .attribute .op{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background:rgba(255,236,164,0.06);}:target{border-right:3px solid rgba(255,180,76,0.85);}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.4);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#39AFD7;}.tooltip::after{background-color:#314559;color:#c5c5c5;border:1px solid #5c6773;}.tooltip::before{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;border-color:#5c6773;}.notable-traits-tooltiptext .notable{border-bottom-color:#5c6773;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}.search-input:focus{}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{}.content span.struct,.content a.struct,.block a.current.struct{}#titles>button:hover,#titles>button.selected{}.content span.type,.content a.type,.block a.current.type{}.content span.union,.content a.union,.block a.current.union{}pre.rust .lifetime{}.stab.unstable{}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){}.content span.enum,.content a.enum,.block a.current.enum{}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{}.content span.keyword,.content a.keyword,.block a.current.keyword{}pre.rust .comment{}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{}pre.rust .kw{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{}pre.rust .doccomment{}.stab.deprecated{}.content a.attr,.content a.derive,.content a.macro{}.stab.portability{}.content span.primitive,.content a.primitive,.block a.current.primitive{}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{}pre.rust .kw-2,pre.rust .prelude-ty{}.content span.trait,.content a.trait,.block a.current.trait{}.search-results a:focus span{}a.result-trait:focus{}a.result-traitalias:focus{}a.result-mod:focus,a.result-externcrate:focus{}a.result-mod:focus{}a.result-externcrate:focus{}a.result-enum:focus{}a.result-struct:focus{}a.result-union:focus{}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{}a.result-type:focus{}a.result-foreigntype:focus{}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{}a.result-constant:focus,a.result-static:focus{}a.result-primitive:focus{}a.result-keyword:focus{}@media (max-width:700px){.sidebar-menu{background-color:#14191f;border-bottom-color:#5c6773;border-right-color:#5c6773;}.sidebar-elems{background-color:#14191f;border-right-color:#5c6773;}#sidebar-filler{background-color:#14191f;border-bottom-color:#5c6773;}}kbd{color:#c5c5c5;background-color:#314559;border-color:#5c6773;border-bottom-color:#5c6773;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#5c6773;background-color:#0f1419;color:#fff;}#theme-picker>img,#settings-menu>img{filter:invert(100);}#copy-path{color:#fff;}#copy-path>img{filter:invert(70%);}#copy-path:hover>img{filter:invert(100%);}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#e0e0e0;}#theme-choices{border-color:#5c6773;background-color:#0f1419;}#theme-choices>button:not(:first-child){border-top-color:#5c6773;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:rgba(110,110,110,0.33);}@media (max-width:700px){#theme-picker{background:#0f1419;}}#all-types{background-color:#14191f;}#all-types:hover{background-color:rgba(70,70,70,0.33);}.search-results .result-name span.alias{color:#c5c5c5;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#14191f;}#sidebar-toggle:hover{background-color:rgba(70,70,70,0.33);}#source-sidebar{background-color:#14191f;}#source-sidebar>.title{color:#fff;border-bottom-color:#5c6773;}div.files>a:hover,div.name:hover{background-color:#14191f;color:#ffb44c;}div.files>.selected{background-color:#14191f;color:#ffb44c;}.setting-line>.title{border-bottom-color:#5c6773;}input:checked+.slider{background-color:#ffb454 !important;} -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/brush1.57.0.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/clipboard1.57.0.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/crates1.57.0.js: -------------------------------------------------------------------------------- 1 | window.ALL_CRATES = ["alloc","core","proc_macro","std","test"]; -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/dark1.57.0.css: -------------------------------------------------------------------------------- 1 | body{background-color:#353535;color:#ddd;}h1,h2,h3,h4{color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3,h4{border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre,.rustdoc.source .example-wrap{background-color:#2A2A2A;}.sidebar{background-color:#505050;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) transparent;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#353535;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#DDD;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#eee !important;background-color:#616161;}.search-results a:focus span{color:#eee !important;}a.result-trait:focus{background-color:#013191;}a.result-traitalias:focus{background-color:#013191;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-mod:focus{background-color:#803a1b;}a.result-externcrate:focus{background-color:#396bac;}a.result-enum:focus{background-color:#5b4e68;}a.result-struct:focus{background-color:#194e9f;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#4950ed;}a.result-type:focus{background-color:#38902c;}a.result-foreigntype:focus{background-color:#b200d6;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#217d1c;}a.result-constant:focus,a.result-static:focus{background-color:#0063cc;}a.result-primitive:focus{background-color:#00708a;}a.result-keyword:focus{background-color:#884719;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#82b089;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#ff7f00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#dd7de8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#a6ae37;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#82a5c9;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#43aec7;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#bda000;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b397da;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#ddd;}body.source .example-wrap pre.rust a{background:#333;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#D2991D;}a.test-arrow{color:#dedede;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}.search-input:disabled{background-color:#c5c4c4;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab,.import-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;color:#2f2f2f;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability>code{background:none;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background-color:#494a3d;}:target{border-right:3px solid #bb7410;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}.notable-traits-tooltiptext .notable{border-bottom-color:#d2d2d2;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#ffb900;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(65%);}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results .result-name span.alias{color:#fff;}.search-results .result-name span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;} -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/light1.57.0.css: -------------------------------------------------------------------------------- 1 | body{background-color:white;color:black;}h1,h2,h3,h4{color:black;}h1.fqn{border-bottom-color:#D5D5D5;}h2,h3,h4{border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre,.rustdoc.source .example-wrap{background-color:#F5F5F5;}.sidebar{background-color:#F1F1F1;}*{scrollbar-color:rgba(36,37,39,0.6) #e6e6e6;}.sidebar{scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;}.logo-container.rust-logo>img{}::-webkit-scrollbar-track{background-color:#ecebeb;}::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar::-webkit-scrollbar-track{background-color:#dcdcdc;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar .current{background-color:#fff;}.source .sidebar{background-color:#fff;}.sidebar .location{border-color:#000;background-color:#fff;color:#333;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#F5F5F5;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#f6fdb0 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#ddd;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.search-results a:hover{background-color:#ddd;}.search-results a:focus{color:#000 !important;background-color:#ccc;}.search-results a:focus span{color:#000 !important;}a.result-trait:focus{background-color:#c7b6ff;}a.result-traitalias:focus{background-color:#c7b6ff;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-enum:focus{background-color:#b4d1b9;}a.result-struct:focus{background-color:#e7b1a0;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#c6afb3;}a.result-type:focus{background-color:#ffc891;}a.result-foreigntype:focus{background-color:#f5c4ff;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#8ce488;}a.result-constant:focus,a.result-static:focus{background-color:#c3e0ff;}a.result-primitive:focus{background-color:#9aecff;}a.result-keyword:focus{background-color:#f99650;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#508157;}.content span.struct,.content a.struct,.block a.current.struct{color:#ad448e;}.content span.type,.content a.type,.block a.current.type{color:#ba5d00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#cd00e2;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#767b27;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#546e8a;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2c8093;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#4d76ae;}.content span.trait,.content a.trait,.block a.current.trait{color:#7c5af3;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#6841f1;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#9a6e31;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}nav:not(.sidebar){border-bottom-color:#e0e0e0;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#000;}body.source .example-wrap pre.rust a{background:#eee;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#3873AD;}a.test-arrow{color:#f5f5f5;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}#crate-search{color:#555;background-color:white;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input{color:#555;background-color:white;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input:focus{border-color:#66afe9;}.search-input:disabled{background-color:#e6e6e6;}#crate-search+.search-input:focus{box-shadow:0 0 8px #078dd8;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;}.stab.portability>code{background:none;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background:#FDFFD3;}:target{border-right:3px solid #ffb44c;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.5);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#eee;border-color:#999;}.notable-traits-tooltiptext .notable{border-bottom-color:#DDDDDD;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F1F1F1;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F1F1F1;border-right-color:#000;}#sidebar-filler{background-color:#F1F1F1;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#717171;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(35%);}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}@media (max-width:700px){#theme-picker{background:#fff;}}#all-types{background-color:#fff;}#all-types:hover{background-color:#f9f9f9;}.search-results .result-name span.alias{color:#000;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#F1F1F1;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F1F1F1;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.setting-line>.title{border-bottom-color:#D5D5D5;} -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/normalize1.57.0.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ 2 | html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/rust-logo1.57.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/rustic-doc/debug_files/enum.Option_files/rust-logo1.57.0.png -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/sidebar-items.js: -------------------------------------------------------------------------------- 1 | initSidebarItems({"enum":[["Option","The `Option` type. See the module level documentation for more."]],"struct":[["IntoIter","An iterator over the value in [`Some`] variant of an [`Option`]."],["Iter","An iterator over a reference to the [`Some`] variant of an [`Option`]."],["IterMut","An iterator over a mutable reference to the [`Some`] variant of an [`Option`]."]]}); -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/storage1.57.0.js: -------------------------------------------------------------------------------- 1 | var resourcesSuffix="1.57.0";var darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue('rustdoc-'+settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed){for(i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(i=0;i=0){updateLocalStorage("rustdoc-preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)} -------------------------------------------------------------------------------- /rustic-doc/debug_files/enum.Option_files/wheel1.57.0.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/ayu1.57.0.css: -------------------------------------------------------------------------------- 1 | body{background-color:#0f1419;color:#c5c5c5;}h1,h2,h3,h4{color:white;}h1.fqn{border-bottom-color:#5c6773;}h1.fqn a{color:#fff;}h2,h3,h4{border-bottom-color:#5c6773;}h4{border:none;}.in-band{background-color:#0f1419;}.invisible{background:rgba(0,0,0,0);}.docblock code{color:#ffb454;}.code-header{color:#e6e1cf;}.docblock pre>code,pre>code{color:#e6e1cf;}span code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}.docblock code,.docblock-short code{background-color:#191f26;}pre,.rustdoc.source .example-wrap{color:#e6e1cf;background-color:#191f26;}.sidebar{background-color:#14191f;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}*{scrollbar-color:#5c6773 transparent;}.sidebar{scrollbar-color:#5c6773 transparent;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar::-webkit-scrollbar-track{background-color:transparent;}.sidebar::-webkit-scrollbar-thumb{background-color:#5c6773;}.sidebar .current{background-color:transparent;color:#ffb44c;}.source .sidebar{background-color:#0f1419;}.sidebar .location{border-color:#000;background-color:#0f1419;color:#fff;}.sidebar-elems .location{color:#ff7733;}.sidebar-elems .location a{color:#fff;}.sidebar .version{border-bottom-color:#424c57;}.sidebar-title{border-top-color:#5c6773;border-bottom-color:#5c6773;}.block a:hover{background:transparent;color:#ffb44c;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#5c6773;}.docblock table td,.docblock table th{border-color:#5c6773;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#c5c5c5;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#000 !important;background-color:#c6afb3;}.search-results a{color:#0096cf;}.search-results a div.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.content span.foreigntype,.content a.foreigntype{color:#ef57ff;}.content span.union,.content a.union{color:#98a01c;}.content span.constant,.content a.constant,.content span.static,.content a.static{color:#6380a0;}.content span.primitive,.content a.primitive{color:#32889b;}.content span.traitalias,.content a.traitalias{color:#57d399;}.content span.keyword,.content a.keyword{color:#de5249;}.content span.externcrate,.content span.mod,.content a.mod{color:#acccf9;}.content span.struct,.content a.struct{color:#ffa0a5;}.content span.enum,.content a.enum{color:#99e0c9;}.content span.trait,.content a.trait{color:#39AFD7;}.content span.type,.content a.type{color:#cfbcf5;}.content span.fn,.content a.fn,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod,.content .fnname{color:#fdd687;}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:#a37acc;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}nav:not(.sidebar){border-bottom-color:#424c57;}nav.main .current{border-top-color:#5c6773;border-bottom-color:#5c6773;}nav.main .separator{border:1px solid #5c6773;}a{color:#c5c5c5;}body.source .example-wrap pre.rust a{background:#333;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#39AFD7;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search{color:#c5c5c5;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;border-color:#424c57;}.search-input{color:#ffffff;background-color:#141920;box-shadow:0 0 0 1px #424c57,0 0 0 2px transparent;transition:box-shadow 150ms ease-in-out;}#crate-search+.search-input:focus{box-shadow:0 0 0 1px #148099,0 0 0 2px transparent;}.search-input:disabled{background-color:#3e3e3e;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable,.stab.deprecated,.stab.portability{color:#c5c5c5;background:#314559 !important;border-style:none !important;border-radius:4px;padding:3px 6px 3px 6px;}.stab.portability>code{color:#e6e1cf;background:none;}#help>div{background:#14191f;box-shadow:0px 6px 20px 0px black;border:none;border-radius:4px;}#help span.bottom,#help span.top{border-color:#5c6773;}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .op,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}pre.rust .attribute .ident,pre.rust .attribute .op{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background:rgba(255,236,164,0.06);}:target{border-right:3px solid rgba(255,180,76,0.85);}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.4);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#39AFD7;}.tooltip::after{background-color:#314559;color:#c5c5c5;border:1px solid #5c6773;}.tooltip::before{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;border-color:#5c6773;}.notable-traits-tooltiptext .notable{border-bottom-color:#5c6773;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}.search-input:focus{}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{}.content span.struct,.content a.struct,.block a.current.struct{}#titles>button:hover,#titles>button.selected{}.content span.type,.content a.type,.block a.current.type{}.content span.union,.content a.union,.block a.current.union{}pre.rust .lifetime{}.stab.unstable{}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){}.content span.enum,.content a.enum,.block a.current.enum{}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{}.content span.keyword,.content a.keyword,.block a.current.keyword{}pre.rust .comment{}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{}pre.rust .kw{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{}pre.rust .doccomment{}.stab.deprecated{}.content a.attr,.content a.derive,.content a.macro{}.stab.portability{}.content span.primitive,.content a.primitive,.block a.current.primitive{}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{}pre.rust .kw-2,pre.rust .prelude-ty{}.content span.trait,.content a.trait,.block a.current.trait{}.search-results a:focus span{}a.result-trait:focus{}a.result-traitalias:focus{}a.result-mod:focus,a.result-externcrate:focus{}a.result-mod:focus{}a.result-externcrate:focus{}a.result-enum:focus{}a.result-struct:focus{}a.result-union:focus{}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{}a.result-type:focus{}a.result-foreigntype:focus{}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{}a.result-constant:focus,a.result-static:focus{}a.result-primitive:focus{}a.result-keyword:focus{}@media (max-width:700px){.sidebar-menu{background-color:#14191f;border-bottom-color:#5c6773;border-right-color:#5c6773;}.sidebar-elems{background-color:#14191f;border-right-color:#5c6773;}#sidebar-filler{background-color:#14191f;border-bottom-color:#5c6773;}}kbd{color:#c5c5c5;background-color:#314559;border-color:#5c6773;border-bottom-color:#5c6773;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#5c6773;background-color:#0f1419;color:#fff;}#theme-picker>img,#settings-menu>img{filter:invert(100);}#copy-path{color:#fff;}#copy-path>img{filter:invert(70%);}#copy-path:hover>img{filter:invert(100%);}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#e0e0e0;}#theme-choices{border-color:#5c6773;background-color:#0f1419;}#theme-choices>button:not(:first-child){border-top-color:#5c6773;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:rgba(110,110,110,0.33);}@media (max-width:700px){#theme-picker{background:#0f1419;}}#all-types{background-color:#14191f;}#all-types:hover{background-color:rgba(70,70,70,0.33);}.search-results .result-name span.alias{color:#c5c5c5;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#14191f;}#sidebar-toggle:hover{background-color:rgba(70,70,70,0.33);}#source-sidebar{background-color:#14191f;}#source-sidebar>.title{color:#fff;border-bottom-color:#5c6773;}div.files>a:hover,div.name:hover{background-color:#14191f;color:#ffb44c;}div.files>.selected{background-color:#14191f;color:#ffb44c;}.setting-line>.title{border-bottom-color:#5c6773;}input:checked+.slider{background-color:#ffb454 !important;} -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/brush1.57.0.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/clipboard1.57.0.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/crates1.57.0.js: -------------------------------------------------------------------------------- 1 | window.ALL_CRATES = ["alloc","core","proc_macro","std","test"]; -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/dark1.57.0.css: -------------------------------------------------------------------------------- 1 | body{background-color:#353535;color:#ddd;}h1,h2,h3,h4{color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3,h4{border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre,.rustdoc.source .example-wrap{background-color:#2A2A2A;}.sidebar{background-color:#505050;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) transparent;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#353535;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#DDD;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#eee !important;background-color:#616161;}.search-results a:focus span{color:#eee !important;}a.result-trait:focus{background-color:#013191;}a.result-traitalias:focus{background-color:#013191;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-mod:focus{background-color:#803a1b;}a.result-externcrate:focus{background-color:#396bac;}a.result-enum:focus{background-color:#5b4e68;}a.result-struct:focus{background-color:#194e9f;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#4950ed;}a.result-type:focus{background-color:#38902c;}a.result-foreigntype:focus{background-color:#b200d6;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#217d1c;}a.result-constant:focus,a.result-static:focus{background-color:#0063cc;}a.result-primitive:focus{background-color:#00708a;}a.result-keyword:focus{background-color:#884719;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#82b089;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#ff7f00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#dd7de8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#a6ae37;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#82a5c9;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#43aec7;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#bda000;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b397da;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#ddd;}body.source .example-wrap pre.rust a{background:#333;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#D2991D;}a.test-arrow{color:#dedede;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}.search-input:disabled{background-color:#c5c4c4;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab,.import-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;color:#2f2f2f;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability>code{background:none;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background-color:#494a3d;}:target{border-right:3px solid #bb7410;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}.notable-traits-tooltiptext .notable{border-bottom-color:#d2d2d2;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#ffb900;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(65%);}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results .result-name span.alias{color:#fff;}.search-results .result-name span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;} -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/light1.57.0.css: -------------------------------------------------------------------------------- 1 | body{background-color:white;color:black;}h1,h2,h3,h4{color:black;}h1.fqn{border-bottom-color:#D5D5D5;}h2,h3,h4{border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre,.rustdoc.source .example-wrap{background-color:#F5F5F5;}.sidebar{background-color:#F1F1F1;}*{scrollbar-color:rgba(36,37,39,0.6) #e6e6e6;}.sidebar{scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;}.logo-container.rust-logo>img{}::-webkit-scrollbar-track{background-color:#ecebeb;}::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar::-webkit-scrollbar-track{background-color:#dcdcdc;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar .current{background-color:#fff;}.source .sidebar{background-color:#fff;}.sidebar .location{border-color:#000;background-color:#fff;color:#333;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#F5F5F5;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#f6fdb0 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#ddd;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.search-results a:hover{background-color:#ddd;}.search-results a:focus{color:#000 !important;background-color:#ccc;}.search-results a:focus span{color:#000 !important;}a.result-trait:focus{background-color:#c7b6ff;}a.result-traitalias:focus{background-color:#c7b6ff;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-enum:focus{background-color:#b4d1b9;}a.result-struct:focus{background-color:#e7b1a0;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#c6afb3;}a.result-type:focus{background-color:#ffc891;}a.result-foreigntype:focus{background-color:#f5c4ff;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#8ce488;}a.result-constant:focus,a.result-static:focus{background-color:#c3e0ff;}a.result-primitive:focus{background-color:#9aecff;}a.result-keyword:focus{background-color:#f99650;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#508157;}.content span.struct,.content a.struct,.block a.current.struct{color:#ad448e;}.content span.type,.content a.type,.block a.current.type{color:#ba5d00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#cd00e2;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#767b27;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#546e8a;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2c8093;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#4d76ae;}.content span.trait,.content a.trait,.block a.current.trait{color:#7c5af3;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#6841f1;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#9a6e31;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}nav:not(.sidebar){border-bottom-color:#e0e0e0;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#000;}body.source .example-wrap pre.rust a{background:#eee;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#3873AD;}a.test-arrow{color:#f5f5f5;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}#crate-search{color:#555;background-color:white;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input{color:#555;background-color:white;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input:focus{border-color:#66afe9;}.search-input:disabled{background-color:#e6e6e6;}#crate-search+.search-input:focus{box-shadow:0 0 8px #078dd8;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;}.stab.portability>code{background:none;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background:#FDFFD3;}:target{border-right:3px solid #ffb44c;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.5);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#eee;border-color:#999;}.notable-traits-tooltiptext .notable{border-bottom-color:#DDDDDD;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F1F1F1;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F1F1F1;border-right-color:#000;}#sidebar-filler{background-color:#F1F1F1;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#717171;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(35%);}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}@media (max-width:700px){#theme-picker{background:#fff;}}#all-types{background-color:#fff;}#all-types:hover{background-color:#f9f9f9;}.search-results .result-name span.alias{color:#000;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#F1F1F1;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F1F1F1;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.setting-line>.title{border-bottom-color:#D5D5D5;} -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/normalize1.57.0.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ 2 | html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/rust-logo1.57.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/rustic-doc/debug_files/primitive.i16_files/rust-logo1.57.0.png -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/storage1.57.0.js: -------------------------------------------------------------------------------- 1 | var resourcesSuffix="1.57.0";var darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue('rustdoc-'+settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed){for(i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(i=0;i=0){updateLocalStorage("rustdoc-preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)} -------------------------------------------------------------------------------- /rustic-doc/debug_files/primitive.i16_files/wheel1.57.0.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rustic-doc/debug_files/shared.rs.html: -------------------------------------------------------------------------------- 1 | shared.rs.html -- source
 1
 2 |  2
 3 |  3
 4 |  4
 5 |  5
 6 |  6
 7 |  7
 8 |  8
 9 |  9
10 | 10
11 | 11
12 | 12
13 | 13
14 | 14
15 | 15
16 | 16
17 | 17
18 | 18
19 | 
20 | use adler32::RollingAdler32;
21 | 
22 | #[doc(hidden)]
23 | pub const MZ_ADLER32_INIT: u32 = 1;
24 | 
25 | #[doc(hidden)]
26 | pub const MZ_DEFAULT_WINDOW_BITS: i32 = 15;
27 | 
28 | pub const HUFFMAN_LENGTH_ORDER: [u8; 19] = [
29 |     16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15,
30 | ];
31 | 
32 | #[doc(hidden)]
33 | pub fn update_adler32(adler: u32, data: &[u8]) -> u32 {
34 |     let mut hash = RollingAdler32::from_value(adler);
35 |     hash.update_buffer(data);
36 |     hash.hash()
37 | }
38 | 
39 |
-------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/brush1.57.0.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/clipboard1.57.0.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/crates1.57.0.js: -------------------------------------------------------------------------------- 1 | window.ALL_CRATES = ["alloc","core","proc_macro","std","test"]; -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/dark1.57.0.css: -------------------------------------------------------------------------------- 1 | body{background-color:#353535;color:#ddd;}h1,h2,h3,h4{color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3,h4{border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre,.rustdoc.source .example-wrap{background-color:#2A2A2A;}.sidebar{background-color:#505050;}.logo-container.rust-logo>img{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}*{scrollbar-color:rgb(64,65,67) #717171;}.sidebar{scrollbar-color:rgba(32,34,37,.6) transparent;}::-webkit-scrollbar-track{background-color:#717171;}::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar::-webkit-scrollbar-track{background-color:#717171;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(32,34,37,.6);}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#353535;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#DDD;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#eee !important;background-color:#616161;}.search-results a:focus span{color:#eee !important;}a.result-trait:focus{background-color:#013191;}a.result-traitalias:focus{background-color:#013191;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-mod:focus{background-color:#803a1b;}a.result-externcrate:focus{background-color:#396bac;}a.result-enum:focus{background-color:#5b4e68;}a.result-struct:focus{background-color:#194e9f;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#4950ed;}a.result-type:focus{background-color:#38902c;}a.result-foreigntype:focus{background-color:#b200d6;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#217d1c;}a.result-constant:focus,a.result-static:focus{background-color:#0063cc;}a.result-primitive:focus{background-color:#00708a;}a.result-keyword:focus{background-color:#884719;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#82b089;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#ff7f00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#dd7de8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#a6ae37;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#82a5c9;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#43aec7;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#bda000;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b397da;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#ddd;}body.source .example-wrap pre.rust a{background:#333;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#D2991D;}a.test-arrow{color:#dedede;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}details.rustdoc-toggle>summary::before,details.undocumented>summary::before{filter:invert(100%);}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}.search-input:disabled{background-color:#c5c4c4;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab,.import-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;color:#2f2f2f;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability>code{background:none;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background-color:#494a3d;}:target{border-right:3px solid #bb7410;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}.notable-traits-tooltiptext .notable{border-bottom-color:#d2d2d2;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#ffb900;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(65%);}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results .result-name span.alias{color:#fff;}.search-results .result-name span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;} -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/light1.57.0.css: -------------------------------------------------------------------------------- 1 | body{background-color:white;color:black;}h1,h2,h3,h4{color:black;}h1.fqn{border-bottom-color:#D5D5D5;}h2,h3,h4{border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre,.rustdoc.source .example-wrap{background-color:#F5F5F5;}.sidebar{background-color:#F1F1F1;}*{scrollbar-color:rgba(36,37,39,0.6) #e6e6e6;}.sidebar{scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;}.logo-container.rust-logo>img{}::-webkit-scrollbar-track{background-color:#ecebeb;}::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar::-webkit-scrollbar-track{background-color:#dcdcdc;}.sidebar::-webkit-scrollbar-thumb{background-color:rgba(36,37,39,0.6);}.sidebar .current{background-color:#fff;}.source .sidebar{background-color:#fff;}.sidebar .location{border-color:#000;background-color:#fff;color:#333;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#F5F5F5;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#f6fdb0 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:#ddd;}.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.search-results a:hover{background-color:#ddd;}.search-results a:focus{color:#000 !important;background-color:#ccc;}.search-results a:focus span{color:#000 !important;}a.result-trait:focus{background-color:#c7b6ff;}a.result-traitalias:focus{background-color:#c7b6ff;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-enum:focus{background-color:#b4d1b9;}a.result-struct:focus{background-color:#e7b1a0;}a.result-union:focus{background-color:#b7bd49;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#c6afb3;}a.result-type:focus{background-color:#ffc891;}a.result-foreigntype:focus{background-color:#f5c4ff;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#8ce488;}a.result-constant:focus,a.result-static:focus{background-color:#c3e0ff;}a.result-primitive:focus{background-color:#9aecff;}a.result-keyword:focus{background-color:#f99650;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#508157;}.content span.struct,.content a.struct,.block a.current.struct{color:#ad448e;}.content span.type,.content a.type,.block a.current.type{color:#ba5d00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#cd00e2;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#767b27;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#546e8a;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2c8093;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#4d76ae;}.content span.trait,.content a.trait,.block a.current.trait{color:#7c5af3;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#6841f1;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#9a6e31;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}nav:not(.sidebar){border-bottom-color:#e0e0e0;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#000;}body.source .example-wrap pre.rust a{background:#eee;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.item-info a,#help a{color:#3873AD;}a.test-arrow{color:#f5f5f5;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before,details.undocumented>summary::before{color:#999;}#crate-search{color:#555;background-color:white;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input{color:#555;background-color:white;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input:focus{border-color:#66afe9;}.search-input:disabled{background-color:#e6e6e6;}#crate-search+.search-input:focus{box-shadow:0 0 8px #078dd8;}.module-item .stab,.import-item .stab{color:#000;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;}.stab.portability>code{background:none;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}#help span.bottom,#help span.top{border-color:#bfbfbf;}.since{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target,:target>*{background:#FDFFD3;}:target{border-right:3px solid #ffb44c;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.5);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#eee;border-color:#999;}.notable-traits-tooltiptext .notable{border-bottom-color:#DDDDDD;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F1F1F1;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F1F1F1;border-right-color:#000;}#sidebar-filler{background-color:#F1F1F1;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu,#help-button{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus,#help-button:hover,#help-button:focus{border-color:#717171;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(35%);}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}@media (max-width:700px){#theme-picker{background:#fff;}}#all-types{background-color:#fff;}#all-types:hover{background-color:#f9f9f9;}.search-results .result-name span.alias{color:#000;}.search-results .result-name span.grey{color:#999;}#sidebar-toggle{background-color:#F1F1F1;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F1F1F1;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.setting-line>.title{border-bottom-color:#D5D5D5;} -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/normalize1.57.0.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ 2 | html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/rust-logo1.57.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emacs-rustic/rustic/194f15c91ace0c3e95a81d315d2a481480d80a3e/rustic-doc/debug_files/trait.AsRef_files/rust-logo1.57.0.png -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/sidebar-items.js: -------------------------------------------------------------------------------- 1 | initSidebarItems({"enum":[["Infallible","The error type for errors that can never happen."]],"fn":[["identity","The identity function."]],"trait":[["AsMut","Used to do a cheap mutable-to-mutable reference conversion."],["AsRef","Used to do a cheap reference-to-reference conversion."],["FloatToInt","Supporting trait for inherent methods of `f32` and `f64` such as `to_int_unchecked`. Typically doesn’t need to be used directly."],["From","Used to do value-to-value conversions while consuming the input value. It is the reciprocal of [`Into`]."],["Into","A value-to-value conversion that consumes the input value. The opposite of [`From`]."],["TryFrom","Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal of [`TryInto`]."],["TryInto","An attempted conversion that consumes `self`, which may or may not be expensive."]]}); -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/storage1.57.0.js: -------------------------------------------------------------------------------- 1 | var resourcesSuffix="1.57.0";var darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");var settingsDataset=(function(){var settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}var dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){var current=getCurrentValue('rustdoc-'+settingName);if(current!==null){return current}if(settingsDataset!==null){var def=settingsDataset[settingName.replace(/-/g,'_')];if(def!==undefined){return def}}return null}var localStoredTheme=getSettingValue("theme");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;var i;if(reversed){for(i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(i=0;i=0){updateLocalStorage("rustdoc-preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)} -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/trait.AsRef.js: -------------------------------------------------------------------------------- 1 | (function() {var implementors = {}; 2 | implementors["alloc"] = [{"text":"impl<T: ?Sized, A: Allocator> AsRef<T> for Box<T, A>","synthetic":false,"types":["alloc::boxed::Box"]},{"text":"impl<T: ?Sized + ToOwned> AsRef<T> for Cow<'_, T>","synthetic":false,"types":["alloc::borrow::Cow"]},{"text":"impl<T: ?Sized> AsRef<T> for Rc<T>","synthetic":false,"types":["alloc::rc::Rc"]},{"text":"impl AsRef<str> for String","synthetic":false,"types":["alloc::string::String"]},{"text":"impl AsRef<[u8]> for String","synthetic":false,"types":["alloc::string::String"]},{"text":"impl<'a> AsRef<str> for Drain<'a>","synthetic":false,"types":["alloc::string::Drain"]},{"text":"impl<'a> AsRef<[u8]> for Drain<'a>","synthetic":false,"types":["alloc::string::Drain"]},{"text":"impl<T: ?Sized> AsRef<T> for Arc<T>","synthetic":false,"types":["alloc::sync::Arc"]},{"text":"impl<'a, T, A: Allocator> AsRef<[T]> for Drain<'a, T, A>","synthetic":false,"types":["alloc::vec::drain::Drain"]},{"text":"impl<T, A: Allocator> AsRef<[T]> for IntoIter<T, A>","synthetic":false,"types":["alloc::vec::into_iter::IntoIter"]},{"text":"impl<T, A: Allocator> AsRef<Vec<T, A>> for Vec<T, A>","synthetic":false,"types":["alloc::vec::Vec"]},{"text":"impl<T, A: Allocator> AsRef<[T]> for Vec<T, A>","synthetic":false,"types":["alloc::vec::Vec"]}]; 3 | implementors["core"] = []; 4 | if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() -------------------------------------------------------------------------------- /rustic-doc/debug_files/trait.AsRef_files/wheel1.57.0.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rustic-doc/filter.lua: -------------------------------------------------------------------------------- 1 | -- Filter to convert rustdoc to org mode 2 | function tablelength(T) 3 | local count = 0 4 | for _ in pairs(T) do count = count + 1 end 5 | return count 6 | end 7 | function table.shallow_copy(t) 8 | local t2 = {} 9 | for k,v in pairs(t) do 10 | t2[k] = v 11 | end 12 | return t2 13 | end 14 | function dump(o) 15 | if type(o) == 'table' then 16 | local s = '{ ' 17 | for k,v in pairs(o) do 18 | if type(k) ~= 'number' then k = '"'..k..'"' end 19 | s = s .. '['..k..'] = ' .. dump(v) .. ',' 20 | end 21 | return s .. '} ' 22 | else 23 | return tostring(o) 24 | end 25 | end 26 | 27 | 28 | Span = function(el) 29 | if tablelength(el.content) >= 3 and el.content[1]["text"] == "Expand" and el.content[3]["text"] == "description" then 30 | return {} 31 | elseif el.classes:includes("since") or el.classes:includes("inner") or tablelength(el.content) == 1 then 32 | return {} 33 | elseif tablelength(el.content) == 0 then 34 | return {} 35 | elseif tablelength(el.content) == 1 then 36 | return el.content 37 | end 38 | end 39 | Image = function(el) 40 | return {} 41 | end 42 | 43 | cleanblocks = { 44 | Str = function(el) 45 | if el.text == "[src]" then 46 | return pandoc.Str(" ") 47 | end 48 | end, 49 | Link = function(el) 50 | return pandoc.Span(el.content) 51 | end, 52 | 53 | Header = function(el) 54 | if el.classes:includes("section-header") then 55 | return {} 56 | end 57 | 58 | if not el.content then 59 | return {} 60 | end 61 | 62 | if el.classes:includes("small-section-header") and el.content and tablelength(el.content) > 0 then 63 | return pandoc.Header(1, pandoc.List({el.content[1]})) 64 | end 65 | 66 | if el.classes:includes("impl") and el.content then 67 | return pandoc.Header(2, pandoc.List({el.content[1]})) 68 | end 69 | 70 | if el.classes:includes("fqn") and el.level == 1 and el.content and el.content[1].content then 71 | crate = "" 72 | for i,v in ipairs(el.content[1].content) do 73 | if v.content and v.content[1].text then 74 | crate = crate .. v.content[1].text .. "::" 75 | end 76 | end 77 | 78 | return pandoc.Header(1, el.content) 79 | end 80 | if el.classes:includes("hidden") then 81 | return pandoc.Plain(el.content) -- We hide the headlines from search results by making them plain. Maybe the solution can be nicer, need to think about it. 82 | -- return pandoc.Header(4, el.content) 83 | end 84 | 85 | 86 | if el.classes:includes("method") then 87 | local code = el.content[1] 88 | local methodname = "" 89 | local must_use_text = "" 90 | local contains_must_use = false 91 | local in_methodname = true 92 | local in_must_use_text = false 93 | 94 | if string.match(code.text, "must_use") then 95 | in_methodname = false 96 | contains_must_use = true 97 | end 98 | 99 | for i = 1, #code.text do 100 | local c = code.text:sub(i, i); 101 | 102 | if in_methodname then 103 | methodname = methodname .. c 104 | elseif in_must_use_text then 105 | must_use_text = must_use_text .. c 106 | end 107 | 108 | if c == "]" then 109 | in_methodname = true 110 | elseif c == "\"" then 111 | in_must_use_text = true 112 | end 113 | end 114 | 115 | if contains_must_use then 116 | return pandoc.List({pandoc.Header(3, pandoc.List({pandoc.Code(methodname)})), pandoc.Plain(must_use_text:sub(1, -3))}) 117 | end 118 | return pandoc.Header(3, pandoc.List({pandoc.Code(methodname)})) 119 | end 120 | 121 | return pandoc.Header(el.level - 1, el.content) 122 | end, 123 | 124 | Div = function(el) 125 | if tablelength(el.content) == 1 then -- Removes one layer of unnecessary nesting. 126 | return el.content 127 | end 128 | if el.classes:includes("shortcuts") or el.classes:includes("sidebar-elems") or el.classes:includes("theme-picker") or el.classes:includes("infos") or el.classes:includes("search-container") or el.classes:includes("sidebar-menu") or el.classes:includes("logo-container") or el.classes:includes("toggle-wrapper") then 129 | return {} 130 | elseif el.classes:includes("variant") and el.classes:includes("small-section-header") and el.content[1] and tablelength(el.content[1].content) > 1 then 131 | return pandoc.List({pandoc.Header(2, pandoc.Code(el.content[1].content[2].text))}) 132 | else 133 | return pandoc.Div(el.content) 134 | end 135 | end, 136 | 137 | Plain = function(el) 138 | for i,v in ipairs(el.content) do 139 | if v.t == "Span" and v.content[1] and v.content[1].t == "Str" and v.content[1].text == "Run" then 140 | return {} 141 | end 142 | 143 | if v.t == "Span" and (v.classes:includes("loading-content") or tablelength(v.content) == 0) and tablelength(el.content) == 1 then --bug here! 1 week later: Why did I not explain what the bug was? I have no idea now. 144 | return {} 145 | end 146 | 147 | if v.t == "Span" and v.classes:includes("emoji") then 148 | table.remove(el.content, 1) 149 | return pandoc.Plain(el.content) 150 | end 151 | end 152 | end, 153 | 154 | CodeBlock = function(el) 155 | if el.classes:includes("line-numbers") then 156 | return {} 157 | else 158 | return pandoc.Para(pandoc.Str("#+BEGIN_SRC rust \n" .. el.text .. "\n#+END_SRC")) 159 | end 160 | end, 161 | 162 | Para = function(el) 163 | if el.content[1] and el.content[1].t == "Span" and tablelength(el.content[1].content) == 0 then 164 | return {} 165 | end 166 | end, 167 | 168 | } 169 | 170 | function Pandoc(el) 171 | return pandoc.Pandoc(pandoc.walk_block(pandoc.Div(el.blocks), cleanblocks), pandoc.Meta({})) 172 | end 173 | -------------------------------------------------------------------------------- /rustic-expand.el: -------------------------------------------------------------------------------- 1 | ;;; rustic-expand.el --- Expand support -*-lexical-binding: t-*- 2 | ;;; Commentary: 3 | 4 | ;; This implements various functionalities related to cargo expand to 5 | ;; show result of expansion 6 | 7 | ;;; Code: 8 | 9 | (require 'rustic-cargo) 10 | (require 'rustic-compile) 11 | 12 | (defvar rustic-expand-process-name "rustic-cargo-expand-process" 13 | "Process name for expand processes.") 14 | 15 | (defvar rustic-expand-buffer-name "*cargo-expand*" 16 | "Buffer name for expand buffers.") 17 | 18 | (defvar rustic-expand-arguments "" 19 | "Holds arguments for `cargo expand', similar to `compilation-arguments`.") 20 | 21 | (defvar rustic-cargo-expand-mode-map 22 | (let ((map (make-sparse-keymap))) 23 | (define-key map [remap recompile] 'rustic-cargo-expand-rerun) 24 | map) 25 | "Local keymap for `rustic-cargo-expand-mode' buffers.") 26 | 27 | (define-derived-mode rustic-cargo-expand-mode rustic-compilation-mode "cargo-expand" 28 | :group 'rustic) 29 | 30 | ;;;###autoload 31 | (defun rustic-cargo-expand (&optional arg) 32 | "Run `cargo expand'. 33 | 34 | If ARG is not nil, use value as argument and store it in 35 | `rustic-expand-arguments'. When calling this function from 36 | `rustic-popup-mode', always use the value of 37 | `rustic-expand-arguments'." 38 | (interactive "P") 39 | (rustic-cargo-expand-command 40 | (cond (arg 41 | (setq rustic-expand-arguments (read-from-minibuffer "Cargo expand arguments: " rustic-expand-arguments))) 42 | (t "")))) 43 | 44 | (defun rustic-cargo-expand-command (&optional expand-args) 45 | "Start compilation process for `cargo expand' with optional EXPAND-ARGS." 46 | (rustic-compilation-process-live) 47 | (let* ((command (list (rustic-cargo-bin) "expand")) 48 | (c (append command (split-string (if expand-args expand-args "")))) 49 | (buf rustic-expand-buffer-name) 50 | (proc rustic-expand-process-name) 51 | (mode 'rustic-cargo-expand-mode)) 52 | (rustic-compilation c (list :buffer buf :process proc :mode mode)))) 53 | 54 | ;;;###autoload 55 | (defun rustic-cargo-expand-rerun () 56 | "Run `cargo expand' with `rustic-expand-arguments'." 57 | (interactive) 58 | (rustic-cargo-expand-command rustic-expand-arguments)) 59 | 60 | (provide 'rustic-expand) 61 | ;;; rustic-expand.el ends here 62 | -------------------------------------------------------------------------------- /rustic-interaction.el: -------------------------------------------------------------------------------- 1 | ;;; rustic-interaction.el --- Common interactive functions -*-lexical-binding: t-*- 2 | 3 | ;;; Code: 4 | 5 | (require 'newcomment) 6 | 7 | (require 'rustic) 8 | 9 | ;;; Miscellaneous 10 | 11 | (defun rustic-docstring-dwim () 12 | "Use `comment-dwim' to make a docstring." 13 | (interactive) 14 | (let ((comment-start "/// ")) 15 | (call-interactively 'comment-dwim))) 16 | 17 | ;;;###autoload 18 | (defun rustic-open-dependency-file () 19 | "Open the 'Cargo.toml' file at the project root if the current buffer is 20 | visiting a project." 21 | (interactive) 22 | (let ((workspace (rustic-buffer-crate t))) 23 | (if workspace 24 | (find-file (concat workspace "/Cargo.toml")) 25 | (message "The current buffer is not inside a rust project!")))) 26 | 27 | ;;; Defun Motions 28 | 29 | ;; TODO: check if we should use `rustic-func-item-beg-re' or 30 | ;; `rust-top-item-beg-re' here. It seems there was a reason 31 | ;; that we added an extra regexp for funcs. 32 | 33 | (defvar rustic-func-item-beg-re 34 | (concat "^" 35 | "\\(?:\\s-*" 36 | (regexp-opt '("priv" "pub")) "\\s-*" 37 | "\\(?:(\\s-*\\(?:in\\s-+\\)?" (regexp-opt '("crate" "self" "super")) "\\s-*)\\)?" 38 | "\\)?" 39 | "\\(?:\\s-*" (regexp-opt '("async" "const")) "\\s-+\\)?" 40 | "\\(?:\\s-*unsafe\\s-+\\)?" 41 | "\\(?:\\s-*extern\\(?:\\s-+\"C\"\\)?\\s-+\\)?" 42 | "\\s-*fn\\s-+") 43 | "Start of a rust function.") 44 | 45 | (defun rustic-beginning-of-function () 46 | "Move to beginning of rust function at point." 47 | (rustic-beginning-of-defun 1)) 48 | 49 | ;; this function only differs from the rust-mode version in applying 50 | ;; `rustic-func-item-beg-re' 51 | (defun rustic-beginning-of-defun (&optional arg) 52 | (interactive "p") 53 | (let* ((arg (or arg 1)) 54 | (magnitude (abs arg)) 55 | (sign (if (< arg 0) -1 1))) 56 | ;; If moving forward, don't find the defun we might currently be 57 | ;; on. 58 | (when (< sign 0) 59 | (end-of-line)) 60 | (catch 'done 61 | (dotimes (_ magnitude) 62 | ;; Search until we find a match that is not in a string or comment. 63 | (while (if (re-search-backward (concat "^\\(" rustic-func-item-beg-re "\\)") 64 | nil 'move sign) 65 | (rust-in-str-or-cmnt) 66 | ;; Did not find it. 67 | (throw 'done nil))))) 68 | t)) 69 | ;;; _ 70 | (provide 'rustic-interaction) 71 | ;;; rustic-interaction.el ends here 72 | -------------------------------------------------------------------------------- /rustic-lsp.el: -------------------------------------------------------------------------------- 1 | ;;; rustic-lsp.el --- Support for lsp -*- lexical-binding:t -*- 2 | ;;; Commentary: 3 | 4 | ;; This library implements support for "lsp". 5 | 6 | ;;; Code: 7 | 8 | (require 'rustic-rustfmt) 9 | 10 | ;;; Options 11 | 12 | ;; FIXME This is non-idomatic. This option should be replaced with 13 | ;; documentation that instructs the user to add the setup function 14 | ;; themselves, iff so desired. 15 | (defcustom rustic-lsp-setup-p t 16 | "Setup LSP related stuff automatically. 17 | If this is non-nil (the default), then loading `rustic-lsp' adds 18 | `rustic-setup-lsp' to `rustic-mode-hook'. If you don't want that 19 | then you must set this to nil before loading `rustic-lsp'." 20 | :type 'boolean 21 | :safe #'booleanp 22 | :group 'rustic) 23 | (when rustic-lsp-setup-p 24 | (add-hook 'rustic-mode-hook 'rustic-setup-lsp)) 25 | 26 | (defcustom rustic-lsp-server 'rust-analyzer 27 | "Choose your LSP server." 28 | :type '(choice (const :tag "rls" rls) 29 | (const :tag "rust-analyzer" rust-analyzer)) 30 | :group 'rustic) 31 | 32 | (define-obsolete-variable-alias 'rustic-rls-pkg 'rustic-lsp-client "Rustic 0.18") 33 | (defcustom rustic-lsp-client 'lsp-mode 34 | "Emacs package for interaction with the language server." 35 | :type '(choice (const :tag "eglot" eglot) 36 | (const :tag "lsp-mode" lsp-mode) 37 | (const :tag "No LSP client" nil)) 38 | :group 'rustic) 39 | 40 | (defcustom rustic-analyzer-command '("rust-analyzer") 41 | "Command for calling rust analyzer." 42 | :type '(repeat (string)) 43 | :group 'rustic) 44 | 45 | (defcustom rustic-enable-detached-file-support nil 46 | "(Experimental) Enable rust-analyzer's detached file support. 47 | 48 | If enabled, rust-analyzer will try to manage a single file 49 | without requiring a dedicate Cargo project. 50 | 51 | Currently, only eglot is supported. Note that due to a current 52 | limitation, the whole directory to which the source file belongs 53 | will be managed. Hence, you should avoid visiting a Rust file 54 | in, e.g. your home directory." 55 | :type 'boolean 56 | :group 'rustic) 57 | 58 | ;;; Common 59 | 60 | (defun rustic-setup-lsp () 61 | "Setup LSP client. If client isn't installed, offer to install it." 62 | (let ((client rustic-lsp-client)) 63 | (cond ((eq client nil) 64 | nil) 65 | ((require client nil t) 66 | (if (eq client 'eglot) 67 | (eglot-ensure) 68 | (rustic-lsp-mode-setup) 69 | (lsp-deferred))) 70 | (t 71 | (rustic-install-lsp-client-p client))))) 72 | 73 | ;;; lsp support 74 | 75 | (defvar lsp-rust-analyzer-macro-expansion-method) 76 | (defvar lsp-rust-analyzer-server-command) 77 | (defvar lsp-rust-server) 78 | (declare-function lsp "lsp-mode" (&optional arg)) 79 | (declare-function lsp-rust-switch-server "lsp-rust" (lsp-server)) 80 | (declare-function lsp-workspace-folders-add "lsp-rust" (project-root)) 81 | (declare-function lsp-workspace-root "lsp-mode" (&optional path)) 82 | 83 | (defun rustic-lsp-mode-setup () 84 | "When changing the `lsp-rust-server', it's also necessary to update the priorities 85 | with `lsp-rust-switch-server'." 86 | (require 'lsp-rust) 87 | (require 'lsp-modeline) 88 | ;; TODO: Do we still need this ? Seems to break stuff (hlissner/doom-emacs/issues/4070) 89 | ;; (lsp-workspace-folders-add (rustic-buffer-workspace)) 90 | (setq lsp-rust-server rustic-lsp-server) 91 | (setq lsp-rust-analyzer-server-command rustic-analyzer-command) 92 | (lsp-rust-switch-server rustic-lsp-server)) 93 | 94 | (defun rustic-install-lsp-client-p (lsp-client) 95 | "Ask user whether to install missing LSP-CLIENT." 96 | (if (yes-or-no-p (format "%s not found. Install it ?" lsp-client)) 97 | (condition-case err 98 | (progn 99 | (package-refresh-contents) 100 | (package-install lsp-client) 101 | (require lsp-client) 102 | (rustic-setup-lsp)) 103 | (error err)) 104 | (message "No LSP server running."))) 105 | 106 | ;;; eglot support 107 | 108 | (defvar eglot-ignored-server-capabilites) 109 | (defvar eglot-server-programs) 110 | (declare-function eglot-ensure "eglot" ()) 111 | 112 | (defun rustic-setup-eglot () 113 | "Configure eglot for rustic." 114 | (require 'eglot) 115 | (if (equal rustic-lsp-server 'rls) 116 | ;; add rustic to `eglot-server-programs' 117 | (let ((rls '(rustic-mode . (eglot-rls "rls")))) 118 | (unless (member rls eglot-server-programs) 119 | (setq eglot-server-programs 120 | `(,rls 121 | ;; replace rust-mode with rustic 122 | ,@(-remove-first (lambda (mode) 123 | (when (symbolp (car mode)) 124 | (eq (car mode) 'rust-mode))) 125 | eglot-server-programs))))) 126 | (add-to-list 'eglot-server-programs `((rustic-mode :language-id "rust") . (eglot-rust-analyzer . ,rustic-analyzer-command))))) 127 | 128 | (with-eval-after-load 'eglot 129 | (defclass eglot-rust-analyzer (eglot-lsp-server) () 130 | :documentation "Rust-analyzer LSP server.") 131 | 132 | (cl-defmethod eglot-initialization-options ((server eglot-rust-analyzer)) 133 | "Pass `detachedFiles' when `rustic-enable-detached-file-support' is non-`nil'." 134 | (if (or (null rustic-enable-detached-file-support) 135 | (null buffer-file-name) 136 | (rustic-buffer-crate t)) 137 | eglot--{} 138 | (list :detachedFiles 139 | (vector (file-local-name (file-truename buffer-file-name)))))) 140 | 141 | (rustic-setup-eglot)) 142 | 143 | ;;; rustic-macro-expansion-mode 144 | 145 | (setq lsp-rust-analyzer-macro-expansion-method 'rustic-analyzer-macro-expand) 146 | 147 | (define-derived-mode rustic-macro-expansion-mode special-mode "Rust" 148 | :group 'rustic 149 | 150 | :syntax-table rust-mode-syntax-table 151 | 152 | ;; Syntax 153 | (setq-local syntax-propertize-function #'rust-syntax-propertize) 154 | 155 | ;; Indentation 156 | (setq-local indent-line-function 'rust-mode-indent-line) 157 | 158 | ;; Fonts 159 | (setq-local font-lock-defaults 160 | '(rust-font-lock-keywords 161 | nil nil nil nil 162 | (font-lock-syntactic-face-function 163 | . rust-mode-syntactic-face-function))) 164 | ) 165 | 166 | ;;;###autoload 167 | (defun rustic-analyzer-macro-expand (result) 168 | "Default method for displaying macro expansion RESULT ." 169 | (rustic--inheritenv 170 | (let* ((root (lsp-workspace-root default-directory)) 171 | (buf (get-buffer-create 172 | (format "*rust-analyzer macro expansion %s*" root)))) 173 | (with-current-buffer buf 174 | (let ((inhibit-read-only t)) 175 | (erase-buffer) 176 | (insert result) 177 | (rustic-macro-expansion-mode))) 178 | (display-buffer buf)))) 179 | 180 | ;;; _ 181 | (provide 'rustic-lsp) 182 | ;;; rustic-lsp.el ends here 183 | -------------------------------------------------------------------------------- /rustic-playground.el: -------------------------------------------------------------------------------- 1 | ;;; rustic-playground.el --- Support for playground -*- lexical-binding:t -*- 2 | ;;; Commentary: 3 | ;;; Code: 4 | 5 | (require 'org-element) 6 | (require 'url) 7 | 8 | ;;; Options 9 | 10 | (defcustom rustic-playground-url-format "https://play.rust-lang.org/?code=%s" 11 | "Format string to use when submitting code to the playground." 12 | :type 'string 13 | :group 'rustic) 14 | 15 | (defcustom rustic-shortener-url-format "https://is.gd/create.php?format=simple&url=%s" 16 | "Format string to use for creating the shortened link of a playground submission." 17 | :type 'string 18 | :group 'rustic) 19 | 20 | (defcustom rustic-playground-enable-shortener t 21 | "Enable shortend URL for playground links." 22 | :type 'boolean 23 | :safe #'booleanp 24 | :group 'rustic) 25 | 26 | ;;; Commands 27 | 28 | ;;;###autoload 29 | (defun rustic-playground (begin end) 30 | "Create a shareable URL for the contents of the current region, 31 | src-block or buffer on the Rust playground." 32 | (interactive "r") 33 | (let (data) 34 | (cond 35 | ((region-active-p) 36 | (setq data (buffer-substring begin end))) 37 | ((org-in-src-block-p) 38 | (setq data (org-element-property :value (org-element-at-point)))) 39 | (t 40 | (setq data (buffer-substring (point-min) (point-max))))) 41 | (let* ((escaped-data (url-hexify-string data)) 42 | (playground-url (format rustic-playground-url-format escaped-data)) 43 | (escaped-playground-url (url-hexify-string playground-url))) 44 | (if (> (length escaped-playground-url) 5000) 45 | (error "Encoded playground data exceeds 5000 character limit (length %s)" 46 | (length escaped-playground-url)) 47 | (let ((shortener-url (format rustic-shortener-url-format escaped-playground-url)) 48 | (url-request-method "POST")) 49 | (if rustic-playground-enable-shortener 50 | (url-retrieve shortener-url 51 | (lambda (state) 52 | ;; filter out the headers etc. included at the 53 | ;; start of the buffer: the relevant text 54 | ;; (shortened url or error message) is exactly 55 | ;; the last line. 56 | (goto-char (point-max)) 57 | (let ((last-line (thing-at-point 'line t)) 58 | (err (plist-get state :error))) 59 | (kill-buffer) 60 | (if err 61 | (error "Failed to shorten playground url: %s" last-line) 62 | (let ((URL (read-from-minibuffer "Playground URL: " last-line))) 63 | (browse-url URL)))))) 64 | (browse-url playground-url))))))) 65 | 66 | 67 | (defun rustic-playground-buffer () 68 | "Create a shareable URL for the contents of the buffer on the Rust playground." 69 | (interactive) 70 | (rustic-playground (point-min) (point-max))) 71 | 72 | (defalias 'rustic-playpen #'rustic-playground) 73 | 74 | ;;; _ 75 | (provide 'rustic-playground) 76 | ;;; rustic-playground.el ends here 77 | -------------------------------------------------------------------------------- /rustic-popup.el: -------------------------------------------------------------------------------- 1 | ;;; rustic-popup.el --- Cargo popup -*-lexical-binding: t-*- 2 | 3 | ;;; Commentary: 4 | 5 | ;; Provides magit like popup. 6 | 7 | ;;; Code: 8 | 9 | (require 'rustic-cargo) 10 | 11 | ;;; Customization 12 | 13 | (defcustom rustic-popup-commands 14 | '((?b "build" build) 15 | (?f "fmt" fmt) 16 | (?r "run" run) 17 | (?c "clippy" clippy) 18 | (?o "outdated" outdated) 19 | (?e "clean" clean) 20 | (?k "check" check) 21 | (?t "test" test) 22 | (?d "doc" doc)) 23 | "List of commands that are displayed in the popup. 24 | The first element of each list contains a command's binding." 25 | :type 'list 26 | :group 'rustic-popup) 27 | 28 | (defcustom rustic-kill-buffer-and-window t 29 | "Whether to kill popup window and buffer after command execution." 30 | :type 'boolean 31 | :group 'rustic) 32 | 33 | (define-obsolete-face-alias 'rustic-popup-key-face 34 | 'rustic-popup-key "1.2") 35 | (define-obsolete-face-alias 'rustic-popup-section-face 36 | 'rustic-popup-section "1.2") 37 | 38 | (defface rustic-popup-key 39 | '((t (:foreground "DeepSkyBlue"))) 40 | "Face used for command shortcuts." 41 | :group 'rustic) 42 | 43 | (defface rustic-popup-section 44 | '((t (:foreground "#f74c00"))) 45 | "Face used for popup section description." 46 | :group 'rustic) 47 | 48 | ;;; Popup Mode 49 | 50 | (defvar rustic-popup-buffer-name "rustic-popup-buffer" 51 | "Buffer name for rustic popup buffers.") 52 | 53 | (defvar rustic--popup-rust-src-name nil 54 | "Rust source code file name from which rustic-popup was invoked.") 55 | 56 | (defvar rustic-popup-mode-map 57 | (let ((map (make-sparse-keymap))) 58 | (define-key map [remap self-insert-command] 'rustic-popup-invoke-popup-action) 59 | (define-key map (kbd "g") 'rustic-recompile) 60 | (define-key map (kbd "RET") 'rustic-popup-default-action) 61 | (define-key map (kbd "") 'rustic-popup-default-action) 62 | (define-key map (kbd "h") 'rustic-popup-cargo-command-help) 63 | (define-key map (kbd "q") 'kill-buffer-and-window) 64 | map) 65 | "Keymap for rustic popup buffers.") 66 | 67 | (define-derived-mode rustic-popup-mode fundamental-mode "RusticPopup" 68 | "Mode for rustic popup buffers." 69 | (setq truncate-lines t) 70 | (setq buffer-read-only t) 71 | (setq-local scroll-margin 0)) 72 | 73 | (defun rustic-popup-insert-backtrace () 74 | "Insert backtrace section." 75 | (let ((inhibit-read-only t) 76 | (prop (lambda (s) 77 | (propertize s 'face 'rustic-popup-section)))) 78 | (insert (funcall prop "Backtrace: ")) 79 | (cond 80 | ((string= rustic-compile-backtrace "0") 81 | (insert " " (funcall prop "0") " | 1 | full")) 82 | ((string= rustic-compile-backtrace "1") 83 | (insert " 0 | " (funcall prop "1") " | full")) 84 | ((string= rustic-compile-backtrace "full") 85 | (insert " 0 | 1 | " (funcall prop "full"))))) 86 | (insert "\n\n")) 87 | 88 | (defun rustic-popup-insert-contents (buf) 89 | "Insert popup buffer contents." 90 | (let ((inhibit-read-only t)) 91 | (with-current-buffer buf 92 | (erase-buffer) 93 | (rustic-popup-mode) 94 | (rustic-popup-insert-backtrace) 95 | (insert (propertize "Commands: " 'face 'rustic-popup-section) "\n") 96 | (insert " " (propertize "g" 'face 'rustic-popup-key) 97 | " " "recompile" " " "\"" 98 | (or (car compilation-arguments) (rustic-compile-command)) 99 | "\"" "\n\n") 100 | (dolist (command rustic-popup-commands) 101 | (insert "\s") 102 | (insert (propertize (char-to-string (nth 0 command)) 103 | 'face 'rustic-popup-key)) 104 | (insert "\s\s\s\s\s\s") 105 | (insert (nth 1 command)) 106 | (when (and (string= (nth 1 command) "test") 107 | (> (length rustic-test-arguments) 0)) 108 | (insert " " "\"" rustic-test-arguments "\"")) 109 | (insert "\n")) 110 | (goto-char (point-min))))) 111 | 112 | ;;;###autoload 113 | (defun rustic-popup (&optional args) 114 | "Setup popup. 115 | If directory is not in a rust project call `read-directory-name'." 116 | (interactive "P") 117 | (rustic--inheritenv 118 | (setq rustic--popup-rust-src-name buffer-file-name) 119 | (let ((func (lambda () 120 | (let ((buf (get-buffer-create rustic-popup-buffer-name)) 121 | (win (split-window-below)) 122 | (inhibit-read-only t)) 123 | (rustic-popup-insert-contents buf) 124 | (set-window-buffer win buf) 125 | (select-window win) 126 | (fit-window-to-buffer) 127 | (set-window-text-height win (+ (window-height) 1)))))) 128 | (if args 129 | (let ((dir (read-directory-name "Rust project:"))) 130 | (let ((default-directory dir)) 131 | (funcall func))) 132 | (funcall func))))) 133 | 134 | ;;; Interactive 135 | 136 | ;;;###autoload 137 | (defun rustic-popup-invoke-popup-action (event) 138 | "Execute commands which are listed in `rustic-popup-commands'." 139 | (interactive (list last-command-event)) 140 | (save-excursion 141 | (let ((char (char-to-string event))) 142 | (save-match-data 143 | (goto-char (point-min)) 144 | (when (re-search-forward (concat "\s" char "\s")) 145 | (goto-char (match-beginning 0))))) 146 | (let* ((command (cadr (split-string 147 | (buffer-substring-no-properties 148 | (point) (line-end-position))))) 149 | (c (intern (concat "rustic-cargo-" command)))) 150 | (if (commandp c) 151 | (call-interactively c) 152 | (call-interactively 'rustic-compile (concat (rustic-cargo-bin) " " command))))) 153 | (when rustic-kill-buffer-and-window 154 | (kill-buffer-and-window))) 155 | 156 | ;;;###autoload 157 | (defun rustic-popup-default-action () 158 | "Change backtrace and `compilation-arguments' when executed on 159 | corresponding line." 160 | (interactive) 161 | (let ((inhibit-read-only t)) 162 | (save-excursion 163 | (goto-char (line-beginning-position)) 164 | (cond 165 | ((looking-at "Backtrace:") 166 | (cond 167 | ((string= rustic-compile-backtrace "0") 168 | (setq rustic-compile-backtrace "1")) 169 | ((string= rustic-compile-backtrace "1") 170 | (setq rustic-compile-backtrace "full")) 171 | ((string= rustic-compile-backtrace "full") 172 | (setq rustic-compile-backtrace "0"))) 173 | (rustic-popup-insert-contents (current-buffer))) 174 | ((search-forward-regexp "\srecompile\s" (line-end-position) t) 175 | (rustic-set-compilation-arguments 176 | (read-string "Compilation arguments: " 177 | (or (car compilation-arguments) 178 | (rustic-compile-command)))) 179 | (rustic-popup-insert-contents (current-buffer))) 180 | ((search-forward-regexp "\stest" (line-end-position) t) 181 | (setq rustic-test-arguments 182 | (read-string "Cargo test arguments: " rustic-test-arguments)) 183 | (rustic-popup-insert-contents (current-buffer))) 184 | (t 185 | (message "No default action for line.")))))) 186 | 187 | ;;; Help Popup 188 | 189 | (defvar rustic-popup-help-buffer-name "rustic-popup-help-buffer" 190 | "Buffer name for rustic popup help buffers.") 191 | 192 | (defvar rustic-popup-help-mode-map 193 | (let ((map (make-sparse-keymap))) 194 | (define-key map (kbd "q") 'rustic-popup-kill-help-buffer) 195 | map) 196 | "Keymap for rustic popup help buffers.") 197 | 198 | (define-derived-mode rustic-popup-help-mode fundamental-mode "RusticHelpPopup" 199 | "Mode for rustic popup help buffers." 200 | (setq truncate-lines t) 201 | (setq buffer-read-only t) 202 | (setq-local scroll-margin 0)) 203 | 204 | ;;;###autoload 205 | (defun rustic-popup-cargo-command-help () 206 | "Display help buffer for cargo command at point." 207 | (interactive) 208 | (let (command) 209 | (save-excursion 210 | (goto-char (line-beginning-position)) 211 | (setq command (cadr (split-string 212 | (buffer-substring-no-properties (line-beginning-position) 213 | (line-end-position)))))) 214 | (let* ((string (rustic-popup-help-flags command)) 215 | (inhibit-read-only t)) 216 | (if (not (and (> (length command) 0) 217 | (> (length (split-string string "\n")) 0))) 218 | (message "No help information for command at point.") 219 | (rustic-popup-setup-help-popup string))))) 220 | 221 | (defun rustic-popup-help-flags (command) 222 | "Get flags of COMMAND." 223 | (let ((string (shell-command-to-string (format "%s %s -h" (rustic-cargo-bin) command))) 224 | flags) 225 | (dolist (s (split-string string "\n")) 226 | (when (and (not (string-match "^\s+\-h" s)) 227 | (string-match "^\s+\-" s)) 228 | (setq flags (concat flags s "\n")))) 229 | flags)) 230 | 231 | (defun rustic-popup-setup-help-popup (string) 232 | "Switch to help buffer." 233 | (rustic--inheritenv 234 | (let ((buf (get-buffer-create rustic-popup-help-buffer-name))) 235 | (switch-to-buffer buf) 236 | (erase-buffer) 237 | (rustic-popup-help-mode) 238 | (insert string) 239 | (fit-window-to-buffer) 240 | (set-window-text-height (selected-window) (+ (window-height) 1)) 241 | (goto-char (point-min))))) 242 | 243 | ;;;###autoload 244 | (defun rustic-popup-kill-help-buffer () 245 | "Kill popup help buffer and switch to popup buffer." 246 | (interactive) 247 | (switch-to-buffer rustic-popup-buffer-name) 248 | (fit-window-to-buffer) 249 | (set-window-text-height (selected-window) (+ (window-height) 1))) 250 | 251 | ;;; _ 252 | (provide 'rustic-popup) 253 | ;;; rustic-popup.el ends here 254 | -------------------------------------------------------------------------------- /rustic-rustfix.el: -------------------------------------------------------------------------------- 1 | ;;; rustic-rustfix.el --- Support for rustfix -*- lexical-binding:t -*- 2 | ;;; Commentary: 3 | 4 | ;; This library implements support for `rustfix', a tool that applies 5 | ;; the suggestions made by `rustc'. 6 | 7 | ;;; Code: 8 | 9 | (require 'rustic-cargo) 10 | 11 | (defvar rustic-rustfix-process-name "rustic-rustfix-process" 12 | "Process name for rustfix processes.") 13 | 14 | (defvar rustic-rustfix-buffer-name "*cargo-rustfix*" 15 | "Buffer name for rustfix buffers.") 16 | 17 | (define-derived-mode rustic-rustfix-mode rustic-compilation-mode "rustfix" 18 | :group 'rustic) 19 | 20 | ;;;###autoload 21 | (defun rustic-rustfix () 22 | "Run `cargo fix'." 23 | (interactive) 24 | (let* ((command (list (rustic-cargo-bin) "fix" "--allow-dirty")) 25 | (err-buf rustic-rustfix-buffer-name) 26 | (proc rustic-rustfix-process-name) 27 | (mode 'rustic-rustfix-mode)) 28 | (rustic-compilation-process-live) 29 | (rustic-compilation-start command (list :buffer err-buf :process proc :mode mode)))) 30 | 31 | ;;; _ 32 | (provide 'rustic-rustfix) 33 | ;;; rustic-rustfix.el ends here 34 | -------------------------------------------------------------------------------- /rustic-spellcheck.el: -------------------------------------------------------------------------------- 1 | ;;; rustic-spellcheck.el --- Spellcheck support -*-lexical-binding: t-*- 2 | ;;; Commentary: 3 | 4 | ;; This implements various functionalities related to cargo spellcheck to 5 | ;; show result of expansion 6 | 7 | ;;; Code: 8 | 9 | (require 'rustic-cargo) 10 | (require 'rustic-compile) 11 | 12 | (defvar rustic-spellcheck-process-name "rustic-cargo-spellcheck-process" 13 | "Process name for spellcheck processes.") 14 | 15 | (defvar rustic-spellcheck-buffer-name "*cargo-spellcheck*" 16 | "Buffer name for spellcheck buffers.") 17 | 18 | (defvar rustic-spellcheck-arguments "" 19 | "Holds arguments for `cargo spellcheck', similar to `compilation-arguments`.") 20 | 21 | (defvar rustic-cargo-spellcheck-mode-map 22 | (let ((map (make-sparse-keymap))) 23 | (define-key map [remap recompile] 'rustic-cargo-spellcheck-rerun) 24 | map) 25 | "Local keymap for `rustic-cargo-spellcheck-mode' buffers.") 26 | 27 | (defvar rustic-spellcheck-error 28 | (let ((err ".*--> ") 29 | (file "\\(.*.rs\\)") 30 | (start-line "\\([0-9]+\\)")) 31 | (let ((re (concat err file ":" start-line))) 32 | (cons re '(1 2 3)))) 33 | "Create hyperlink in compilation buffers for spellcheck errors.") 34 | 35 | (defun rustic-spellcheck-compilation (command &optional args) 36 | "Start a spellcheck compilation process with COMMAND. 37 | 38 | ARGS is a plist that affects how the process is run. 39 | - `:no-display' don't display buffer when starting compilation process 40 | - `:buffer' name for process buffer 41 | - `:process' name for compilation process 42 | - `:mode' mode for process buffer 43 | - `:directory' set `default-directory' 44 | - `:sentinel' process sentinel" 45 | (rustic--inheritenv 46 | (let* ((buf (get-buffer-create 47 | (or (plist-get args :buffer) rustic-compilation-buffer-name))) 48 | (process (or (plist-get args :process) rustic-compilation-process-name)) 49 | (mode (or (plist-get args :mode) 'rustic-compilation-mode)) 50 | (directory (or (plist-get args :directory) (funcall rustic-compile-directory-method))) 51 | (workspace (rustic-buffer-workspace (plist-get args :no-default-dir))) 52 | (sentinel (or (plist-get args :sentinel) #'rustic-compilation-sentinel)) 53 | (file-buffer (current-buffer))) 54 | (rustic-compilation-setup-buffer buf directory mode) 55 | (setq next-error-last-buffer buf) 56 | (unless (plist-get args :no-display) 57 | (funcall rustic-compile-display-method buf)) 58 | (with-current-buffer buf 59 | (let ((inhibit-read-only t)) 60 | (insert (format "%s \n" (s-join " " command)))) 61 | (rustic-make-process :name process 62 | :buffer buf 63 | :command command 64 | :file-buffer file-buffer 65 | :filter #'rustic-compilation-filter 66 | :sentinel sentinel 67 | :workspace workspace 68 | :file-handler t))))) 69 | 70 | (define-compilation-mode rustic-cargo-spellcheck-mode "rustic-cargo-spellcheck" 71 | "Rust spellcheck compilation mode. 72 | 73 | Error matching regexes from compile.el are removed." 74 | (setq-local compilation-message-face 'rustic-message) 75 | (setq-local compilation-error-face 'rustic-compilation-error) 76 | (setq-local compilation-warning-face 'rustic-compilation-warning) 77 | (setq-local compilation-info-face 'rustic-compilation-info) 78 | (setq-local compilation-column-face 'rustic-compilation-column) 79 | (setq-local compilation-line-face 'rustic-compilation-line) 80 | 81 | (setq-local compilation-error-regexp-alist-alist nil) 82 | (add-to-list 'compilation-error-regexp-alist-alist 83 | (cons 'rustic-spell-error rustic-spellcheck-error)) 84 | 85 | (setq-local compilation-error-regexp-alist nil) 86 | (add-to-list 'compilation-error-regexp-alist 'rustic-spell-error)) 87 | 88 | ;;;###autoload 89 | (defun rustic-cargo-spellcheck (&optional arg) 90 | "Run `cargo spellcheck'. 91 | 92 | If ARG is not nil, use value as argument and store it in 93 | `rustic-spellcheck-arguments'. When calling this function from 94 | `rustic-popup-mode', always use the value of 95 | `rustic-spellcheck-arguments'." 96 | (interactive "P") 97 | (rustic-cargo-spellcheck-command 98 | (cond (arg 99 | (setq rustic-spellcheck-arguments 100 | (read-from-minibuffer "Cargo spellcheck arguments: " rustic-spellcheck-arguments))) 101 | (t "")))) 102 | 103 | (defun rustic-cargo-spellcheck-command (&optional spellcheck-args) 104 | "Start compilation process for `cargo spellcheck' with optional SPELLCHECK-ARGS." 105 | (let* ((command (list (rustic-cargo-bin) "spellcheck")) 106 | (c (append command (split-string (if spellcheck-args spellcheck-args "")))) 107 | (buf rustic-spellcheck-buffer-name) 108 | (proc rustic-spellcheck-process-name) 109 | (mode 'rustic-cargo-spellcheck-mode)) 110 | (rustic-spellcheck-compilation c (list :buffer buf :process proc :mode mode)))) 111 | 112 | ;;;###autoload 113 | (defun rustic-cargo-spellcheck-rerun () 114 | "Run `cargo spellcheck' with `rustic-spellcheck-arguments'." 115 | (interactive) 116 | (rustic-cargo-spellcheck-command rustic-spellcheck-arguments)) 117 | 118 | (provide 'rustic-spellcheck) 119 | ;;; rustic-spellcheck.el ends here 120 | -------------------------------------------------------------------------------- /rustic.el: -------------------------------------------------------------------------------- 1 | ;;; rustic.el --- Rust development environment -*-lexical-binding: t-*- 2 | 3 | ;; Version: 3.4 4 | ;; Author: Mozilla 5 | ;; 6 | ;; Keywords: languages 7 | ;; Package-Requires: ((emacs "28.2") (rust-mode "1.0.6") (dash "2.13.0") (f "0.18.2") (let-alist "1.0.4") (markdown-mode "2.3") (project "0.3.0") (s "1.10.0") (spinner "1.7.3") (xterm-color "1.6")) 8 | 9 | ;; This file is distributed under the terms of both the MIT license and the 10 | ;; Apache License (version 2.0). 11 | 12 | ;;; Commentary: 13 | 14 | ;; This package is based on rust-mode and provides additional features: 15 | ;; 16 | ;; - rust-analyzer configuration 17 | ;; - flycheck integration 18 | ;; - cargo popup 19 | ;; - multiline error parsing 20 | ;; - translation of ANSI control sequences through xterm-color 21 | ;; - async org babel 22 | ;; - custom compilation process 23 | ;; - rustfmt errors in a rust compilation mode 24 | ;; - automatic rust-analyzer configuration with eglot or lsp-mode 25 | ;; - cask for testing 26 | ;; - requires emacs 26 27 | ;; - and more 28 | 29 | ;;; Code: 30 | 31 | (require 'cl-lib) 32 | (require 'pcase) 33 | (require 'subr-x) 34 | 35 | (require 'dash) 36 | 37 | (setq rust-load-optional-libraries nil) 38 | (setq rust-before-save-hook #'rustic-before-save-hook) 39 | (setq rust-after-save-hook #'rustic-after-save-hook) 40 | (require 'rust-mode) 41 | 42 | ;;; Customization 43 | 44 | (defgroup rustic nil 45 | "Support for Rust code." 46 | :link '(url-link "https://www.rustic-lang.org/") 47 | :group 'languages) 48 | 49 | ;;; Define aliases for removed rustic functions 50 | 51 | (if (and (version<= "29.1" emacs-version) rust-mode-treesitter-derive) 52 | (progn 53 | (require 'rust-ts-mode) 54 | (defvaralias 'rustic-indent-offset 'rust-ts-mode-indent-offset)) 55 | (progn 56 | (defvaralias 'rustic-indent-offset 'rust-indent-offset) 57 | (defvaralias 'rustic-indent-method-chain 'rust-indent-method-chain) 58 | (defvaralias 'rustic-indent-where-clause 'rust-indent-where-clause) 59 | (defvaralias 'rustic-match-angle-brackets 'rust-match-angle-brackets) 60 | (defvaralias 'rustic-indent-return-type-to-arguments 'rust-indent-return-type-to-arguments) 61 | (defalias 'rustic-indent-line #'rust-mode-indent-line) 62 | (defalias 'rustic-end-of-defun #'rust-end-of-defun))) 63 | 64 | ;;; workaround for with-temp-buffer not propagating the environment, as per 65 | ;;; https://github.com/magit/magit/pull/4169 66 | (defmacro rustic--with-temp-process-buffer (&rest body) 67 | "Like `with-temp-buffer', but always propagate `process-environment' and `exec-path'. 68 | When those vars are buffer-local in the calling buffer, they are not 69 | propagated by `with-temp-buffer', so we explicitly ensure that 70 | happens, so that processes will be invoked consistently. BODY is 71 | as for that macro." 72 | (declare (indent 0) (debug (body))) 73 | (let ((p (cl-gensym)) 74 | (e (cl-gensym))) 75 | `(let ((,p process-environment) 76 | (,e exec-path)) 77 | (with-temp-buffer 78 | (setq-local process-environment ,p) 79 | (setq-local exec-path ,e) 80 | ,@body)))) 81 | 82 | ;;; Workspace 83 | 84 | (defvar-local rustic--buffer-workspace nil 85 | "Use function `rustic-buffer-workspace' instead.") 86 | 87 | (defun rustic-buffer-workspace (&optional nodefault) 88 | "Get workspace for the current buffer." 89 | ;; this variable is buffer local so we can use the cached value 90 | (if rustic--buffer-workspace 91 | rustic--buffer-workspace 92 | ;; Resolve the bin path while still buffer local (in cases like 93 | ;; remote via TRAMP) 94 | (let ((cargo-bin (rustic-cargo-bin))) 95 | (rustic--with-temp-process-buffer 96 | (let ((ret (process-file cargo-bin nil (list (current-buffer) nil) nil "locate-project" "--workspace"))) 97 | (cond ((and (/= ret 0) nodefault) 98 | (error "`cargo locate-project' returned %s status: %s" ret (buffer-string))) 99 | ((and (/= ret 0) (not nodefault)) 100 | (setq rustic--buffer-workspace default-directory)) 101 | (t 102 | (goto-char 0) 103 | (let* ((output (json-read)) 104 | (dir (file-name-directory (cdr (assoc-string "root" output))))) 105 | (setq rustic--buffer-workspace dir))))))))) 106 | 107 | (defun rustic-buffer-crate (&optional nodefault) 108 | "Return the crate for the current buffer. 109 | When called outside a Rust project, then return `default-directory', 110 | or if NODEFAULT is non-nil, then fall back to returning nil." 111 | (let ((dir (locate-dominating-file default-directory "Cargo.toml"))) 112 | (when dir 113 | (setq dir (expand-file-name dir))) 114 | (or dir 115 | (and (not nodefault) 116 | default-directory)))) 117 | 118 | (defcustom rustic-compile-directory-method 'rustic-buffer-crate 119 | "Choose function that returns the directory used when calling 120 | cargo commands. 121 | 122 | If you want to use the workspace you can use `rustic-buffer-workspace'. 123 | Note that there may exist functionality that has higher priority than 124 | this variable." 125 | :type 'function 126 | :group 'rustic) 127 | 128 | ;;; Mode 129 | 130 | (defvar rustic-mode-map 131 | (let ((map (make-sparse-keymap))) 132 | (define-key map (kbd "C-c C-p") 'rustic-popup) 133 | 134 | (define-key map (kbd "C-c C-c C-u") 'rustic-compile) 135 | (define-key map (kbd "C-c C-c C-i") 'rustic-recompile) 136 | (define-key map (kbd "C-c C-c C-o") 'rustic-format-buffer) 137 | (define-key map (kbd "C-c C-c C-,") 'rustic-docstring-dwim) 138 | 139 | (define-key map (kbd "C-c C-c C-b") 'rustic-cargo-build) 140 | (define-key map (kbd "C-c C-c C-k") 'rustic-cargo-check) 141 | (define-key map (kbd "C-c C-c C-r") 'rustic-cargo-run) 142 | (define-key map (kbd "C-c C-c C-f") 'rustic-cargo-fmt) 143 | (define-key map (kbd "C-c C-c C-t") 'rustic-cargo-test) 144 | (define-key map (kbd "C-c C-c C-c") 'rustic-cargo-current-test) 145 | (define-key map (kbd "C-c C-c C-l") 'rustic-cargo-clippy) 146 | (define-key map (kbd "C-c C-c C-n") 'rustic-cargo-outdated) 147 | (define-key map (kbd "C-c C-c n") 'rustic-cargo-new) 148 | (define-key map (kbd "C-c C-c i") 'rustic-cargo-init) 149 | (define-key map (kbd "C-c C-c b") 'rustic-cargo-bench) 150 | (define-key map (kbd "C-c C-c d") 'rustic-cargo-doc) 151 | (define-key map (kbd "C-c C-c c") 'rustic-cargo-clean) 152 | (define-key map (kbd "C-c C-c k") 'rustic-cargo-clippy) 153 | (define-key map (kbd "C-c C-c f") 'rustic-cargo-clippy-fix) 154 | ;; cargo edit 155 | (define-key map (kbd "C-c C-c a") 'rustic-cargo-add) 156 | (define-key map (kbd "C-c C-c r") 'rustic-cargo-rm) 157 | (define-key map (kbd "C-c C-c u") 'rustic-cargo-upgrade) 158 | map) 159 | "Keymap for `rustic-mode'.") 160 | 161 | ;;;###autoload 162 | (define-derived-mode rustic-mode rust-mode "Rustic" 163 | "Major mode for Rust code. 164 | 165 | \\{rustic-mode-map}" 166 | :group 'rustic 167 | 168 | (when (bound-and-true-p rustic-cargo-auto-add-missing-dependencies) 169 | (add-hook 'lsp-after-diagnostics-hook 'rustic-cargo-add-missing-dependencies-hook nil t))) 170 | 171 | ;;;###autoload 172 | (add-to-list 'auto-mode-alist '("\\.rs\\'" . rustic-mode)) 173 | 174 | ;; remove rust-mode and rust-ts-mode from `auto-mode-alist' 175 | (let ((mode '("\\.rs\\'" . rust-mode)) 176 | (ts-mode '("\\.rs\\'" . rust-ts-mode))) 177 | (when (member mode auto-mode-alist) 178 | (setq auto-mode-alist (remove mode auto-mode-alist))) 179 | (when (member ts-mode auto-mode-alist) 180 | (setq auto-mode-alist (remove ts-mode auto-mode-alist)))) 181 | 182 | ;;; envrc support 183 | 184 | ;; To support envrc, it is necessary to wrap any buffer creation code 185 | ;; with inheritenv. Rather than depend on that package, we conditionally 186 | ;; wrap if it is installed. Users of envrc ought to ensure the inheritenv 187 | ;; package is available before loading rustic. 188 | 189 | (defmacro rustic--inheritenv (&rest body) 190 | "Wrap BODY so that the environment it sees will match the current value. 191 | This is useful if BODY creates a temp buffer, because that will 192 | not inherit any buffer-local values of variables `exec-path' and 193 | `process-environment'." 194 | `(if (featurep 'inheritenv) 195 | (inheritenv-apply (lambda () ,@body)) 196 | ,@body)) 197 | 198 | ;;; _ 199 | 200 | (defun rustic-reload () 201 | "Reload rustic package." 202 | (interactive) 203 | (unload-feature 'rustic) 204 | (require 'rustic) 205 | (rustic-mode)) 206 | 207 | (provide 'rustic) 208 | 209 | (require 'rustic-interaction) 210 | 211 | (defvar rustic-load-optional-libraries t 212 | "Whether loading `rustic' also loads optional libraries. 213 | This variable might soon be remove again.") 214 | 215 | (when rustic-load-optional-libraries 216 | (require 'rustic-compile) 217 | (require 'rustic-popup) 218 | (require 'rustic-cargo) 219 | (require 'rustic-doc) 220 | (require 'rustic-clippy) 221 | (require 'rustic-comint) 222 | (require 'rustic-babel) 223 | (require 'rustic-rustfmt) 224 | (require 'rustic-rustfix) 225 | (require 'rustic-playground) 226 | (require 'rustic-lsp) 227 | (require 'rustic-expand) 228 | (require 'rustic-spellcheck) 229 | (with-eval-after-load 'flycheck 230 | (require 'rustic-flycheck))) 231 | 232 | ;;; rustic.el ends here 233 | -------------------------------------------------------------------------------- /test/all-tests.el: -------------------------------------------------------------------------------- 1 | (require 'rustic-clippy-test) 2 | (require 'rustic-cargo-test) 3 | (require 'rustic-babel-test) 4 | (require 'rustic-compilation-error-tests) 5 | (require 'rustic-compile-test) 6 | ;; (require 'rustic-doc-test) 7 | (require 'rustic-format-test) 8 | (require 'rustic-window-test) 9 | (require 'rustic-workspace-test) 10 | -------------------------------------------------------------------------------- /test/rustic-clippy-test.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t -*- 2 | 3 | (require 'rustic) 4 | (load (expand-file-name "test-helper.el" 5 | (file-name-directory 6 | (or load-file-name buffer-file-name)))) 7 | 8 | (ert-deftest rustic-test-trigger-and-fix-format-on-compile () 9 | (ignore-errors (kill-buffer (get-buffer rustic-compilation-buffer-name))) 10 | (let* ((buffer1 (get-buffer-create "b1")) 11 | (string "fn main() { String::from(' ').extend(String::from(' ').chars()); } ") 12 | (formatted-string "fn main() {\n String::from(' ').push_str(&String::from(' '));\n}\n") 13 | (dir (rustic-babel-generate-project t))) 14 | (let* ((default-directory dir) 15 | (src (concat dir "/src")) 16 | (file1 (expand-file-name "main.rs" src)) 17 | (rustic-cargo-clippy-trigger-fix 'on-compile) 18 | (rustic-format-trigger 'on-compile)) 19 | (with-current-buffer buffer1 20 | (insert string) 21 | (write-file file1)) 22 | 23 | (if-let ((proc (call-interactively 'rustic-cargo-build))) 24 | (while (eq (process-status proc) 'run) 25 | (sit-for 0.01))) 26 | 27 | (with-current-buffer buffer1 28 | (revert-buffer t t) 29 | (should (string= (buffer-string) formatted-string))) 30 | (should-not (get-buffer rustic-clippy-buffer-name)) 31 | (kill-buffer buffer1)))) 32 | 33 | (ert-deftest rustic-test-fix-format-on-compile-default-and-format () 34 | (ignore-errors (kill-buffer (get-buffer rustic-compilation-buffer-name))) 35 | (let* ((buffer1 (get-buffer-create "b1")) 36 | (string "fn main() { String::from(' ').extend(String::from(' ').chars()); } ") 37 | (formatted-string "fn main() { 38 | String::from(' ').extend(String::from(' ').chars()); 39 | }\n") 40 | (dir (rustic-babel-generate-project t)) 41 | (compilation-read-command nil)) 42 | (let* ((default-directory dir) 43 | (src (concat dir "/src")) 44 | (file1 (expand-file-name "main.rs" src)) 45 | ;; (rustic-cargo-clippy-trigger-fix 'on-compile) 46 | (rustic-format-trigger 'on-compile)) 47 | (with-current-buffer buffer1 48 | (insert string) 49 | (write-file file1)) 50 | 51 | (if-let ((proc (call-interactively 'rustic-compile))) 52 | (rustic-test--wait-till-finished rustic-compilation-buffer-name)) 53 | 54 | (with-current-buffer buffer1 55 | (revert-buffer t t) 56 | (should (string= (buffer-string) formatted-string))) 57 | (should-not (get-buffer rustic-clippy-buffer-name)) 58 | (kill-buffer buffer1)))) 59 | 60 | (ert-deftest rustic-test-trigger-and-fix-format-on-compile-clippy-error () 61 | (ignore-errors (kill-buffer (get-buffer rustic-clippy-buffer-name))) 62 | (let* ((buffer1 (get-buffer-create "b1")) 63 | (string "ffn main() { String::from(' ').extend(String::from(' ').chars()); } ") 64 | (formatted-string "fn main() {\n String::from(' ').push_str(&String::from(' '));\n}\n") 65 | (dir (rustic-babel-generate-project t))) 66 | (let* ((default-directory dir) 67 | (src (concat dir "/src")) 68 | (file1 (expand-file-name "main.rs" src)) 69 | (rustic-cargo-clippy-trigger-fix 'on-compile) 70 | (rustic-format-trigger 'on-compile)) 71 | (with-current-buffer buffer1 72 | (insert string) 73 | (write-file file1)) 74 | 75 | (if-let ((proc (call-interactively 'rustic-cargo-build))) 76 | (rustic-test--wait-till-finished rustic-compilation-buffer-name)) 77 | 78 | (with-current-buffer buffer1 79 | (revert-buffer t t) 80 | (should-not (string= (buffer-string) formatted-string))) 81 | (should (get-buffer rustic-clippy-buffer-name)) 82 | (kill-buffer (get-buffer rustic-clippy-buffer-name)) 83 | (kill-buffer buffer1)))) 84 | 85 | (ert-deftest rustic-test-clippy () 86 | (let* ((string "fn main() { 87 | String::from(' ').extend(String::from(' ').chars()); 88 | }\n") 89 | (buf (rustic-test-count-error-helper-new string)) 90 | (default-directory (file-name-directory (buffer-file-name buf)))) 91 | (call-interactively 'rustic-cargo-clippy) 92 | (let* ((proc (get-process rustic-clippy-process-name)) 93 | (buffer (process-buffer proc))) 94 | (rustic-test--wait-till-finished rustic-clippy-buffer-name) 95 | (with-current-buffer buffer 96 | (should (string-match "^warning:\s" (buffer-substring-no-properties (point-min) (point-max))))) 97 | (should (string= (s-join " " (process-get proc 'command)) 98 | (concat (rustic-cargo-bin) " clippy " 99 | rustic-default-clippy-arguments)))) 100 | (should (string= rustic-clippy-arguments "")) 101 | 102 | (kill-buffer (get-buffer rustic-clippy-buffer-name)) 103 | (call-interactively 'rustic-cargo-clippy-rerun) 104 | (let* ((proc (get-process rustic-clippy-process-name)) 105 | (buffer (process-buffer proc))) 106 | (rustic-test--wait-till-finished rustic-clippy-buffer-name) 107 | (with-current-buffer buffer 108 | (should (string-match "^warning:\s" (buffer-substring-no-properties (point-min) (point-max))))) 109 | (should (string= rustic-clippy-arguments ""))) 110 | (kill-buffer buf))) 111 | 112 | (ert-deftest rustic-test-clippy-fix () 113 | (let* ((string "fn main() { let s = vec![1].first();}") 114 | (buf (rustic-test-count-error-helper-new string)) 115 | (default-directory (file-name-directory (buffer-file-name buf)))) 116 | (with-current-buffer buf 117 | (call-interactively 'rustic-cargo-clippy-fix) 118 | (let* ((proc (get-process rustic-clippy-process-name)) 119 | (buffer (process-buffer proc))) 120 | (rustic-test--wait-till-finished rustic-clippy-buffer-name) 121 | (revert-buffer t t) 122 | (should (string= (buffer-string) "#![allow(non_snake_case)]\nfn main() { let s = [1].first();}")))))) 123 | 124 | (provide 'rustic-clippy-test) 125 | -------------------------------------------------------------------------------- /test/rustic-compile-test.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t -*- 2 | ;; Before editing, eval (load-file "test-helper.el") 3 | (require 'rustic) 4 | (load (expand-file-name "test-helper.el" 5 | (file-name-directory 6 | (or load-file-name buffer-file-name)))) 7 | 8 | (ert-deftest rustic-test-format-next-error-last-buffer () 9 | (let* ((string "fn main() {}") 10 | (buf (rustic-test-count-error-helper-new string)) 11 | (default-directory (file-name-directory (buffer-file-name buf)))) 12 | (with-current-buffer buf 13 | (erase-buffer) 14 | (fundamental-mode) 15 | (should-error (rustic-format-buffer)) 16 | (rustic-mode) 17 | (insert string) 18 | (backward-char 10) 19 | (let ((proc (rustic-format-start-process 20 | 'rustic-format-sentinel 21 | :buffer (current-buffer) 22 | :stdin (buffer-string)))) 23 | (with-current-buffer (process-buffer proc) 24 | (should (eq next-error-last-buffer buf))) 25 | (while (eq (process-status proc) 'run) 26 | (sit-for 0.1)) 27 | (sit-for 0.5))))) 28 | 29 | (ert-deftest rustic-test-save-some-buffers () 30 | (let* ((buffer1 (get-buffer-create "b1")) 31 | (buffer2 (get-buffer-create "b2")) 32 | (string "fn main() {}") 33 | (formatted-string "fn main() {}\n") 34 | (dir (rustic-babel-generate-project t)) 35 | (rustic-format-trigger 'on-save) 36 | (compilation-ask-about-save nil)) 37 | (let* ((default-directory dir) 38 | (src (concat dir "/src")) 39 | (file1 (expand-file-name "main.rs" src)) 40 | (file2 (progn (shell-command-to-string "touch src/test.rs") 41 | (expand-file-name "test.rs" src)))) 42 | (with-current-buffer buffer1 43 | (write-file file1) 44 | (insert string)) 45 | (with-current-buffer buffer2 46 | (write-file file2) 47 | (insert string)) 48 | (rustic-save-some-buffers t) 49 | (sit-for 1) 50 | (with-current-buffer buffer1 51 | (should (string= (buffer-string) formatted-string))) 52 | (with-current-buffer buffer2 53 | (should (string= (buffer-string) formatted-string)))) 54 | (kill-buffer buffer1) 55 | (kill-buffer buffer2))) 56 | 57 | (ert-deftest rustic-test-save-some-buffers-compilation-ask-about-save () 58 | (let* ((buffer1 (get-buffer-create "b1")) 59 | (buffer2 (get-buffer-create "b2")) 60 | (string "fn main() {}") 61 | (formatted-string "fn main() {}\n") 62 | (dir (rustic-babel-generate-project t)) 63 | (rustic-format-trigger 'on-save) 64 | (buffer-save-without-query nil) 65 | (compilation-ask-about-save nil)) 66 | (let* ((default-directory dir) 67 | (src (concat dir "/src")) 68 | (file1 (expand-file-name "main.rs" src)) 69 | (file2 (progn (shell-command-to-string "touch src/test.rs") 70 | (expand-file-name "test.rs" src)))) 71 | (with-current-buffer buffer1 72 | (write-file file1) 73 | (insert string)) 74 | (with-current-buffer buffer2 75 | (write-file file2) 76 | (insert string)) 77 | (rustic-save-some-buffers t) 78 | (sit-for 1) 79 | (with-current-buffer buffer1 80 | (should (string= (buffer-string) formatted-string))) 81 | (with-current-buffer buffer2 82 | (should (string= (buffer-string) formatted-string)))) 83 | (kill-buffer buffer1) 84 | (kill-buffer buffer2))) 85 | 86 | (ert-deftest rustic-test-compile () 87 | (let* ((dir (rustic-babel-generate-project t))) 88 | (let* ((default-directory dir) 89 | (proc (rustic-compile "cargo fmt"))) 90 | (should (process-live-p proc)) 91 | (while (eq (process-status proc) 'run) 92 | (sit-for 0.1)) 93 | (should (string= compilation-directory dir)) 94 | (let ((proc (rustic-recompile nil))) 95 | (while (eq (process-status proc) 'run) 96 | (sit-for 0.1))) 97 | (should (string= (car compilation-arguments) "cargo fmt")) 98 | (should (string= compilation-directory dir)))) 99 | (setq compilation-directory nil) 100 | (setq compilation-arguments nil)) 101 | 102 | (ert-deftest rustic-test-compile-interactive () 103 | (let* ((dir (rustic-babel-generate-project t))) 104 | (let* ((default-directory dir) 105 | (compilation-read-command nil) 106 | (proc (call-interactively 'rustic-compile))) 107 | (should (process-live-p proc)) 108 | (while (eq (process-status proc) 'run) 109 | (sit-for 0.1)) 110 | (should (string= compilation-directory dir)) 111 | (let ((proc (rustic-recompile nil))) 112 | (while (eq (process-status proc) 'run) 113 | (sit-for 0.1))) 114 | (should (string= (car compilation-arguments) "cargo build")) 115 | (should (string= compilation-directory dir)))) 116 | (setq compilation-directory nil) 117 | (setq compilation-arguments nil)) 118 | 119 | (ert-deftest rustic-test-recompile () 120 | (let* ((string "fn main() { let s = 1;}") 121 | (buf (rustic-test-count-error-helper-new string)) 122 | (default-directory (file-name-directory (buffer-file-name buf))) 123 | (rustic-format-trigger nil)) 124 | (with-current-buffer buf 125 | (let* ((proc (rustic-compile "cargo build")) 126 | (buffer (process-buffer proc))) 127 | (while (eq (process-status proc) 'run) 128 | (sit-for 0.01)) 129 | (should (= 0 (process-exit-status proc))) 130 | (let ((p (rustic-recompile nil))) 131 | (while (eq (process-status proc) 'run) 132 | (sit-for 0.1)) 133 | (should (= 0 (process-exit-status p)))))))) 134 | 135 | (ert-deftest rustic-test-backtrace () 136 | (kill-buffer (get-buffer rustic-compilation-buffer-name)) 137 | (let* ((string "fn main() { 138 | let v = vec![1, 2, 3]; 139 | v[99]; 140 | }") 141 | (default-directory (rustic-test-count-error-helper string))) 142 | (let ((rustic-compile-backtrace "0") 143 | (proc (rustic-compilation-start (split-string "cargo run")))) 144 | (while (eq (process-status proc) 'run) 145 | (sit-for 0.1)) 146 | (with-current-buffer (get-buffer rustic-compilation-buffer-name) 147 | (should (= compilation-num-errors-found 1)))) 148 | (let ((rustic-compile-backtrace "1") 149 | (proc (rustic-compilation-start (split-string "cargo run")))) 150 | (while (eq (process-status proc) 'run) 151 | (sit-for 0.1)) 152 | (with-current-buffer (get-buffer rustic-compilation-buffer-name) 153 | (should (= compilation-num-errors-found 1)))) 154 | (let ((rustic-compile-backtrace "full") 155 | (proc (rustic-compilation-start (split-string "cargo run")))) 156 | (while (eq (process-status proc) 'run) 157 | (sit-for 0.1)) 158 | (with-current-buffer (get-buffer rustic-compilation-buffer-name) 159 | (should (= compilation-num-errors-found 1)))))) 160 | 161 | (provide 'rustic-compile-test) 162 | -------------------------------------------------------------------------------- /test/rustic-doc-test.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t -*- 2 | (require 'rustic) 3 | 4 | (ert-deftest rustic-doc-setup-test () 5 | (rustic-doc-setup nil t) 6 | ;; The setup is async, so we can't continue immediately. 7 | (should (file-exists-p rustic-doc-convert-prog)) 8 | (should (file-exists-p rustic-doc-lua-filter)) 9 | (while (get-buffer (concat "*" "rustic-doc-std-conversion" "*")) 10 | (sleep-for 1)) 11 | (should (file-exists-p "~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/std/option")) 12 | (should (file-exists-p (f-join rustic-doc-save-loc "std" "option" "enum.Option.org")))) 13 | 14 | (ert-deftest rustic-doc-semver-test () 15 | (should (equal (rustic-doc--semver-from-string "1.0.0") '(1 0 0))) 16 | (should (equal (rustic-doc--semver-from-string "1.0.0-alpha") '(1 0 0))) 17 | (should (equal (rustic-doc--semver-from-string "1.0.0.1") '(1 0 0))) 18 | 19 | (setq cmp-test-vectors (list (list "1.0.0" "1.0.0.1" nil) 20 | (list "1.0.0" "1.0.0-alpha" nil) 21 | (list "2.0.1" "2.0.0" t) 22 | (list "2.1.0" "2.0.0" t) 23 | (list "2.1.1" "2.1.0" t))) 24 | 25 | (dolist (test cmp-test-vectors) 26 | (let ((v1 (rustic-doc--semver-from-string (car test))) 27 | (v2 (rustic-doc--semver-from-string (cadr test))) 28 | (expected (caddr test))) 29 | (should (equal (rustic-doc--semver-greater v1 v2) expected))))) 30 | 31 | (ert-deftest rustic-doc-verstion-extract-test () 32 | (should (equal (rustic-doc--extract-version "fd 10.1.0 33 | ") (list 10 1 0))) 34 | (should (equal (rustic-doc--extract-version "pandoc 3.1.11.1 35 | Features: +server +lua 36 | Scripting engine: Lua 5.4 37 | User data directory: /Users/user/.local/share/pandoc 38 | Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org 39 | This is free software; see the source for copying conditions. There is no 40 | warranty, not even for merchantability or fitness for a particular purpose.") (list 3 1 11)))) 41 | 42 | (provide 'rustic-doc-test) 43 | -------------------------------------------------------------------------------- /test/rustic-lsp-mode-test.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t -*- 2 | ;; Before editing, eval (load-file "test-helper.el") 3 | 4 | ;; TODO: FIX 5 | 6 | ;; (setq lsp-restart 'ignore) 7 | 8 | ;; (require 'lsp-mode) 9 | ;; (require 'lsp-rust) 10 | ;; (require 'lsp-modeline) 11 | 12 | ;; (ert-deftest rustic-test-rustic-lsp-server () 13 | ;; "Test if value of `rustic-lsp-server' is used and priority set correctly." 14 | ;; (let ((rustic-lsp-setup-p t) 15 | ;; (rustic-lsp-server 'rust-analyzer)) 16 | ;; ;; check if rust-analyzer starts 17 | ;; (let* ((dir (rustic-babel-generate-project t)) 18 | ;; (main (expand-file-name "main.rs" (concat dir "/src"))) 19 | ;; (buf (get-buffer-create "test"))) 20 | ;; (with-current-buffer buf 21 | ;; (write-file main)) 22 | ;; (with-current-buffer buf 23 | ;; (sit-for 1) 24 | ;; (should (lsp-find-workspace 'rust-analyzer default-directory)) 25 | ;; (with-lsp-workspace (lsp-find-workspace 'rust-analyzer default-directory) 26 | ;; (lsp--shutdown-workspace)) 27 | ;; (sit-for 1) 28 | ;; (should-not (lsp-find-workspace 'rust-analyzer default-directory))) 29 | ;; (kill-buffer buf)))) 30 | 31 | 32 | -------------------------------------------------------------------------------- /test/rustic-window-test.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t -*- 2 | (require 'rustic) 3 | (load (expand-file-name "test-helper.el" 4 | (file-name-directory 5 | (or load-file-name buffer-file-name)))) 6 | 7 | (ert-deftest rustic-test-window-count () 8 | (should (= (length (window-list)) 1)) 9 | (let* ((dir (rustic-babel-generate-project t))) 10 | (let* ((default-directory dir)) 11 | (rustic-compile "cargo fmt") 12 | (rustic-test--wait-till-finished rustic-compilation-buffer-name) 13 | (should (= (length (window-list)) 2)) 14 | (should (get-buffer-window rustic-compilation-buffer-name))))) 15 | 16 | (ert-deftest rustic-test-window-count-format-proc () 17 | (should (= (length (window-list)) 1)) 18 | (let* ((string "ffn main() {}") 19 | (formatted-string "fn main() {}\n") 20 | (buf (rustic-test-count-error-helper-new string)) 21 | (default-directory (file-name-directory (buffer-file-name buf))) 22 | (buffer-read-only nil)) 23 | (with-current-buffer buf 24 | (erase-buffer) 25 | (rustic-mode) 26 | (insert string) 27 | (rustic-format-buffer) 28 | (rustic-test--wait-till-finished rustic-format-buffer-name) 29 | (should (= (length (window-list)) 2)) 30 | (should (get-buffer-window rustic-format-buffer-name))) 31 | (kill-buffer buf))) 32 | 33 | (provide 'rustic-window-test) 34 | -------------------------------------------------------------------------------- /test/rustic-workspace-test.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t -*- 2 | ;; Before editing, eval (load-file "test-helper.el") 3 | (require 'rustic) 4 | (load (expand-file-name "test-helper.el" 5 | (file-name-directory 6 | (or load-file-name buffer-file-name)))) 7 | 8 | (ert-deftest rust-test-workspace-crate-location () 9 | (should (equal (funcall rustic-compile-directory-method) default-directory)) 10 | (let* ((test-workspace (expand-file-name "test/test-project/")) 11 | (test-crate (expand-file-name "test/test-project/crates/test-crate/"))) 12 | (let ((default-directory (expand-file-name "src" test-crate))) 13 | (should (string= (rustic-buffer-workspace) test-workspace)) 14 | (should (string= (rustic-buffer-crate) test-crate))))) 15 | 16 | ;; just test if project-root function works for different versions 17 | (ert-deftest rust-test-project-root () 18 | (should (equal (rustic-project-root (project-current)) default-directory))) 19 | 20 | ;; test if only test-workspace will be compiled with `rustic-buffer-crate' 21 | ;; and not another-test-workspace 22 | (ert-deftest rustic-test-rustic-buffer-crate () 23 | (let* ((test-workspace (expand-file-name "test/test-project/")) 24 | (test-crate (expand-file-name "test/test-project/crates/test-crate/"))) 25 | (let ((default-directory (expand-file-name "src" test-crate))) 26 | (rustic-cargo-build) 27 | (let* ((proc (get-process rustic-compilation-process-name)) 28 | (buffer (process-buffer proc))) 29 | (rustic-test--wait-till-finished rustic-compilation-buffer-name) 30 | (with-current-buffer buffer 31 | (should (string-match "Compiling test-crate" (buffer-substring-no-properties (point-min) (point-max)))) 32 | (should-not (string-match "Compiling another-test-crate" (buffer-substring-no-properties (point-min) (point-max))))))))) 33 | 34 | ;; test if both crates will be compiled with `rustic-buffer-workspace' 35 | (ert-deftest rustic-test-rustic-buffer-workspace () 36 | (let* ((test-workspace (expand-file-name "test/test-project/")) 37 | (test-crate (expand-file-name "test/test-project/crates/test-crate/")) 38 | (rustic-compile-directory-method 'rustic-buffer-workspace)) 39 | (let ((default-directory (expand-file-name "src" test-crate))) 40 | (rustic-cargo-build) 41 | (let* ((proc (get-process rustic-compilation-process-name)) 42 | (buffer (process-buffer proc))) 43 | (rustic-test--wait-till-finished rustic-compilation-buffer-name) 44 | (with-current-buffer buffer 45 | ;; (print (buffer-substring-no-properties (point-min) (point-max))) 46 | (should (string-match "Compiling test-crate" (buffer-substring-no-properties (point-min) (point-max)))) 47 | (should (string-match "Compiling another-test-crate" (buffer-substring-no-properties (point-min) (point-max))))))))) 48 | 49 | (provide 'rustic-workspace-test) 50 | -------------------------------------------------------------------------------- /test/test-helper.el: -------------------------------------------------------------------------------- 1 | ;; -*- lexical-binding: t -*- 2 | 3 | (require 'ert) 4 | 5 | (require 'f) 6 | (let ((rustic-dir (f-parent (f-dirname (f-this-file))))) 7 | (add-to-list 'load-path rustic-dir)) 8 | 9 | (setq rustic-load-optional-libraries t) 10 | (setq rustic-lsp-setup-p nil) ; don't start LSP server for every test 11 | (setq auto-save-default nil) 12 | 13 | (require 'rustic) 14 | 15 | (custom-set-variables '(indent-tabs-mode nil)) 16 | 17 | (defsubst rustic-compare-code-after-manip (_original _point-pos _manip-func expected got) 18 | (equal expected got)) 19 | 20 | (defun rustic-test-manip-code (original point-pos manip-func expected) 21 | (with-temp-buffer 22 | (rustic-mode) 23 | (insert original) 24 | (goto-char point-pos) 25 | (funcall manip-func) 26 | (should (rustic-compare-code-after-manip 27 | original point-pos manip-func expected (buffer-string))))) 28 | 29 | ;; TODO: rename 30 | (defun rustic-test-count-error-helper (string) 31 | (let* ((buffer (get-buffer-create "b")) 32 | (dir (rustic-babel-generate-project t)) 33 | (src (concat dir "/src")) 34 | (file (expand-file-name "main.rs" src)) 35 | (rustic-format-trigger nil)) 36 | (with-current-buffer buffer 37 | (write-file file) 38 | (insert "#[allow(non_snake_case)]") 39 | (insert string) 40 | (save-buffer)) 41 | dir)) 42 | 43 | (defun rustic-test-count-error-helper-new (string) 44 | (let* ((buffer (get-buffer-create "b")) 45 | (default-directory rustic-org-babel-temporary-directory) 46 | (dir (rustic-babel-generate-project t)) 47 | (file (expand-file-name "main.rs" (concat dir "/src"))) 48 | (default-directory dir)) 49 | (write-region (concat "#![allow(non_snake_case)]\n" string) 50 | nil file nil 0) 51 | (with-current-buffer buffer 52 | (find-file file)) 53 | (get-file-buffer file))) 54 | 55 | (defmacro rustic-test-silence (messages &rest body) 56 | `(cl-letf* (((symbol-function 'm) 57 | (symbol-function #'message)) 58 | ((symbol-function #'message) 59 | (lambda (format-string &rest args) 60 | (unless (member format-string ,messages) 61 | (apply 'm format-string args))))) 62 | ,@body)) 63 | 64 | (defun test-indent (indented &optional deindented) 65 | (let ((deindented 66 | (or deindented 67 | (replace-regexp-in-string "^[[:blank:]]*" " " indented)))) 68 | (rustic-test-manip-code 69 | deindented 70 | 1 71 | (lambda () 72 | (rustic-test-silence 73 | '("%s %s" ; "Indenting..." progress-reporter-do-update 74 | "%sdone") ; "Indenting...done" progress-reporter-done 75 | (indent-region 1 (+ 1 (buffer-size))))) 76 | indented))) 77 | 78 | (defun rustic-test-group-str-by-face (str) 79 | "Fontify `STR' in rust-mode and group it by face, returning a 80 | list of substrings of `STR' each followed by its face." 81 | (cl-loop with fontified = (rustic-test-fontify-string str) 82 | for start = 0 then end 83 | while start 84 | for end = (next-single-property-change start 'face fontified) 85 | for prop = (get-text-property start 'face fontified) 86 | for text = (substring-no-properties fontified start end) 87 | if prop 88 | append (list text prop))) 89 | 90 | (defun rustic-test-font-lock (source face-groups) 91 | "Test that `SOURCE' fontifies to the expected `FACE-GROUPS'" 92 | (should (equal (rustic-test-group-str-by-face source) 93 | face-groups))) 94 | 95 | (defun rustic-test-fontify-string (str) 96 | (with-temp-buffer 97 | (rustic-mode) 98 | (insert str) 99 | (font-lock-ensure) 100 | (font-lock-flush) 101 | (buffer-string))) 102 | 103 | (defun rustic-mode-auto-save-hook () 104 | "Enable auto-saving in rustic-mode buffers." 105 | (when buffer-file-name 106 | (setq-local compilation-ask-about-save nil))) 107 | (add-hook 'rustic-mode-hook 'rustic-mode-auto-save-hook) 108 | 109 | (defun rustic-test--wait-till-finished (buffer) 110 | "Wait till the BUFFER has exited." 111 | (let* ((proc (get-buffer-process buffer))) 112 | (while (not (eq (process-status proc) 'exit)) 113 | (sit-for 0.2)))) 114 | -------------------------------------------------------------------------------- /test/test-project-single-crate/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "test-crate" 7 | version = "0.0.1" 8 | 9 | [[package]] 10 | name = "test-project" 11 | version = "0.0.1" 12 | dependencies = [ 13 | "test-crate", 14 | ] 15 | -------------------------------------------------------------------------------- /test/test-project-single-crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["test"] 3 | name = "test-project" 4 | description = "test" 5 | version = "0.0.1" 6 | 7 | [workspace] 8 | members = ["crates/*"] 9 | 10 | [dependencies] 11 | test-crate = { version = "0.0.1", path = "crates/test-crate" } 12 | 13 | [lib] 14 | path = "lib.rs" -------------------------------------------------------------------------------- /test/test-project-single-crate/crates/test-crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test-crate" 3 | version = "0.0.1" -------------------------------------------------------------------------------- /test/test-project-single-crate/crates/test-crate/src/lib.rs: -------------------------------------------------------------------------------- 1 | uuse libc; 2 | -------------------------------------------------------------------------------- /test/test-project-single-crate/crates/test-crate/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | () 3 | } 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/test-project/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "another-test-crate" 7 | version = "0.0.1" 8 | 9 | [[package]] 10 | name = "bar" 11 | version = "0.0.1" 12 | 13 | [[package]] 14 | name = "depend-on-test-crate" 15 | version = "0.0.1" 16 | dependencies = [ 17 | "test-crate", 18 | ] 19 | 20 | [[package]] 21 | name = "foo" 22 | version = "0.0.1" 23 | 24 | [[package]] 25 | name = "test-crate" 26 | version = "0.0.1" 27 | 28 | [[package]] 29 | name = "test-project" 30 | version = "0.0.1" 31 | dependencies = [ 32 | "another-test-crate", 33 | "depend-on-test-crate", 34 | "test-crate", 35 | ] 36 | -------------------------------------------------------------------------------- /test/test-project/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["test"] 3 | name = "test-project" 4 | description = "test" 5 | version = "0.0.1" 6 | 7 | [workspace] 8 | members = ["crates/*"] 9 | 10 | [dependencies] 11 | test-crate = { version = "0.0.1", path = "crates/test-crate" } 12 | another-test-crate = { version = "0.0.1", path = "crates/another-test-crate" } 13 | depend-on-test-crate = { version = "0.0.1", path = "crates/depend-on-test-crate" } 14 | 15 | [lib] 16 | path = "lib.rs" -------------------------------------------------------------------------------- /test/test-project/crates/another-test-crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "another-test-crate" 3 | version = "0.0.1" 4 | -------------------------------------------------------------------------------- /test/test-project/crates/another-test-crate/src/lib.rs: -------------------------------------------------------------------------------- 1 | uuse libc; 2 | -------------------------------------------------------------------------------- /test/test-project/crates/bar/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bar" 3 | version = "0.0.1" 4 | -------------------------------------------------------------------------------- /test/test-project/crates/bar/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub fn bar() { 2 | () 3 | } 4 | -------------------------------------------------------------------------------- /test/test-project/crates/depend-on-test-crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "depend-on-test-crate" 3 | version = "0.0.1" 4 | 5 | [dependencies] 6 | test-crate = { version = "0.0.1", path = "../test-crate" } -------------------------------------------------------------------------------- /test/test-project/crates/depend-on-test-crate/src/lib.rs: -------------------------------------------------------------------------------- 1 | uuse libc; 2 | -------------------------------------------------------------------------------- /test/test-project/crates/foo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "foo" 3 | version = "0.0.1" 4 | -------------------------------------------------------------------------------- /test/test-project/crates/foo/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub fn foo() { 2 | () 3 | } 4 | -------------------------------------------------------------------------------- /test/test-project/crates/test-crate/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test-crate" 3 | version = "0.0.1" -------------------------------------------------------------------------------- /test/test-project/crates/test-crate/src/lib.rs: -------------------------------------------------------------------------------- 1 | uuse libc; 2 | -------------------------------------------------------------------------------- /test/test-project/crates/test-crate/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | () 3 | } 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------