Last active
April 3, 2019 04:47
-
-
Save sile/c92348d3dd5b6580bda1500bcb31e712 to your computer and use it in GitHub Desktop.
Revisions
-
sile revised this gist
Sep 18, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -167,6 +167,7 @@ Emacs - travis: https://github.com/sile/libflate/blob/master/.travis.yml - コードカバレッジ計測: - kcovを使えば一応可能 - codecovとの連携: https://github.com/codecov/example-rust - 開発サイクル: - 基本は`cargo check`ないし`cargo test`とコード修正の繰り返し - 少し変わった処理を走らせたり確認したい場合には`cargo run --examples FILENAME`でコマンド実行 -
sile revised this gist
Jun 30, 2017 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,6 @@ - 関連(未読): https://github.com/brson/rust-api-guidelines - https://danielkeep.github.io/tlborm/book/README.html - マクロ周りの解説 - http://doc.crates.io/guide.html - Cargoのドキュメント - Cargoは結構多機能なので、ドキュメントには一通り目を通しておくと便利 -
sile revised this gist
Jun 6, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -125,7 +125,7 @@ Emacs - ロガー - https://crates.io/crates/log の方が標準的っぽくはあるけど、slogの方が設計思想的に好み - サーバやライブラリではなく、通常のバイナリ(コマンド)で使うならslogの機能は過剰かも - slogを手軽に扱えるようにするための軽いライブラリ: https://github.com/sile/sloggers - trackable: - 主にエラーハンドリング用のライブラリ - Rustでのエラーハンドリング自体に関しては[Rustbook](https://doc.rust-lang.org/book/error-handling.html)が詳しい -
sile revised this gist
Jun 6, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -124,8 +124,8 @@ Emacs - https://github.com/slog-rs/slog - ロガー - https://crates.io/crates/log の方が標準的っぽくはあるけど、slogの方が設計思想的に好み - サーバやライブラリではなく、通常のバイナリ(コマンド)で使うならslogの機能は過剰かも - slogを手軽に扱えるようにするための軽いライブラリ: https://github.com/sile/sloggers - trackable: - 主にエラーハンドリング用のライブラリ - Rustでのエラーハンドリング自体に関しては[Rustbook](https://doc.rust-lang.org/book/error-handling.html)が詳しい -
sile revised this gist
Jun 6, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -124,7 +124,7 @@ Emacs - https://github.com/slog-rs/slog - ロガー - https://crates.io/crates/log の方が標準的っぽくはあるけど、slogの方が設計思想的に好み - サーバやライブラリではなく、通常のバイナリ(コマンド)で使うならslogの機能は過剰かも - slogを手軽に扱えるようにするための軽いライブラリ: https://github.com/sile/sloggers - trackable: - 主にエラーハンドリング用のライブラリ -
sile revised this gist
Jun 6, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -124,7 +124,8 @@ Emacs - https://github.com/slog-rs/slog - ロガー - https://crates.io/crates/log の方が標準的っぽくはあるけど、slogの方が設計思想的に好み - サーバやライブラリではなく、通常のバイナリ(コマンド)で使うならslogの機能は過剰かも - slogを手軽に扱えるようにするための軽いライブラリ: https://github.com/sile/sloggers - trackable: - 主にエラーハンドリング用のライブラリ - Rustでのエラーハンドリング自体に関しては[Rustbook](https://doc.rust-lang.org/book/error-handling.html)が詳しい -
sile revised this gist
Jun 6, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -149,8 +149,8 @@ Emacs - その他: - byteorder, rand, num, etc リリース周り ----------- - https://crates.io/ にアカウントを登録して`cargo publish`でリリース(パッケージ登録)が可能 - `Cargo.toml`ファイルの参考: https://github.com/sile/libflate/blob/master/Cargo.toml -
sile revised this gist
Jun 6, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -136,7 +136,7 @@ Emacs - serde: - https://github.com/serde-rs/serde - シリアライズライブラリ - `serde_derive`と組み合わせることで`#[derive(Serialize, Deserialize)]`と書くだけで、たいていのデータ構造がシリアライズ可能になるので便利 - 設定ファイルの読み込み処理や、ネットワークを跨いだデータ転送時のデータ変換処理等を自前で書かなくても良くなる - 少し複雑な設定をコマンドに指定したいなら、clapではなく、serde+tomlを使った方が楽 - [serdeconv](https://github.com/sile/serdeconv)でTOML/JSON/MessagePackに関する変換を手軽に行える -
sile revised this gist
Jun 6, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -119,6 +119,7 @@ Emacs - 凄く多機能、かつ、直観的に使えて便利 - exampleコマンド(`crate-root/examples/*.rs`)が凄く簡単に作れる - (自作の)ほぼ全てのライブラリの`dev-dependencies`に含まれている - 例: https://github.com/sile/erl_tokenize/blob/master/examples/tokenize.rs#L12 - slog: - https://github.com/slog-rs/slog - ロガー -
sile revised this gist
Jun 6, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -167,6 +167,6 @@ Emacs - コードカバレッジ計測: - kcovを使えば一応可能 - 開発サイクル: - 基本は`cargo check`ないし`cargo test`とコード修正の繰り返し - 少し変わった処理を走らせたり確認したい場合には`cargo run --examples FILENAME`でコマンド実行 - リリース前には`cargo doc`で生成されたドキュメントを確認しつつ諸々微調整を行う -
sile revised this gist
Jun 6, 2017 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -81,6 +81,8 @@ Emacs ;; - Ctrl-C + Ctrl-C + Ctrl-V ;; - ドキュメント生成: ;; - Ctrl-C + Ctrl-C + Ctrl-D ;; - 前回実行コマンドの再実行: ;; - Ctrl-C + Ctrl-C + Ctrl-C (package-install 'cargo) ;; コード補完とか定義元に飛んだりとか @@ -133,7 +135,7 @@ Emacs - serde: - https://github.com/serde-rs/serde - シリアライズライブラリ - `serde_derive`と組み合わせることで`#[derive(Serialize, Deserialize)]`と書くだけで、たいていのデータ構造がシリアライズ可能になるので便利 - 設定ファイルの読み込み処理や、ネットワークを跨いだデータ転送時のデータ変換処理等を自前で書かなくても良くなる - 少し複雑な設定をコマンドに指定したいなら、clapではなく、serde+tomlを使った方が楽 - [serdeconv](https://github.com/sile/serdeconv)でTOML/JSON/MessagePackに関する変換を手軽に行える @@ -163,4 +165,8 @@ Emacs - `crateルート/examples/*.rs`のファイル群は`caro run --example FILENAME`で実行可能 - travis: https://github.com/sile/libflate/blob/master/.travis.yml - コードカバレッジ計測: - kcovを使えば一応可能 - 開発サイクル: - 基本は`cargo check`ないし`cargo test`とコード修正の繰り返し - 少し変わった処理を走らせたり確認したい場合には`cargo run --examples FILENAME`でコマンド実行 - リリース前には`cargo doc`で生成されたドキュメントを確認しつつ諸々微調整を行う -
sile revised this gist
Jun 6, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -116,7 +116,7 @@ Emacs - コマンドライン引数パーサ - 凄く多機能、かつ、直観的に使えて便利 - exampleコマンド(`crate-root/examples/*.rs`)が凄く簡単に作れる - (自作の)ほぼ全てのライブラリの`dev-dependencies`に含まれている - slog: - https://github.com/slog-rs/slog - ロガー -
sile revised this gist
Jun 6, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ 2017年6月時点のRustの開発用メモ ============================== 注意 ---- -
sile revised this gist
Jun 6, 2017 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -120,8 +120,7 @@ Emacs - slog: - https://github.com/slog-rs/slog - ロガー - https://crates.io/crates/log の方が標準的っぽくはあるけど、slogの方が設計思想的に好み - slogを手軽に扱えるようにするための軽いライブラリ: https://github.com/sile/sloggers - trackable: - 主にエラーハンドリング用のライブラリ -
sile revised this gist
Jun 6, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -162,5 +162,6 @@ Emacs ------ - `crateルート/examples/*.rs`のファイル群は`caro run --example FILENAME`で実行可能 - travis: https://github.com/sile/libflate/blob/master/.travis.yml - コードカバレッジ計測: - kcovを使えば一応可能 -
sile revised this gist
Jun 6, 2017 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -120,7 +120,8 @@ Emacs - slog: - https://github.com/slog-rs/slog - ロガー - https://crates.io/crates/log の方が標準的っぽくはあるけど、slogの方が設計思想的に好み - slogを手軽に扱えるようにするための軽いライブラリ: https://github.com/sile/sloggers - trackable: - 主にエラーハンドリング用のライブラリ @@ -153,6 +154,8 @@ Emacs - `Cargo.toml`ファイルの参考: https://github.com/sile/libflate/blob/master/Cargo.toml - crates.ioにpublishすると自動で `https://docs.rs/` にも(バージョン毎の)ドキュメントを生成してくれる - 例: https://docs.rs/libflate/ - ライブラリのリリース前には、crateレベルで`#![warn(missing_docs)]`を指定 - 公開コンポーネントに対するドキュメント記述漏れを防止 - バイナリのcrateを登録した場合には`cargo install CRATE_NAME`でインストールが可能になる その他 -
sile revised this gist
Jun 6, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -116,6 +116,7 @@ Emacs - コマンドライン引数パーサ - 凄く多機能、かつ、直観的に使えて便利 - exampleコマンド(`crate-root/examples/*.rs`)が凄く簡単に作れる - (自作の)ほぼ全てのライブラリの`dev-dependencies`に含まれている - slog: - https://github.com/slog-rs/slog - ロガー -
sile revised this gist
Jun 6, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -68,6 +68,7 @@ Emacs ;; Rustモード (package-install 'rust-mode) ;; Cargoモード ;; ;; 以下を良く使う: @@ -90,6 +91,8 @@ Emacs ### .emacs ```lisp ;; ソース: https://github.com/sile/dotfiles/blob/master/.emacs (add-hook 'rust-mode-hook #'cargo-minor-mode) (add-hook 'rust-mode-hook #'racer-mode) @@ -99,9 +102,6 @@ Emacs (add-hook 'racer-mode-hook #'eldoc-mode) (add-hook 'racer-mode-hook #'company-mode) (setq company-tooltip-align-annotations t) (setq racer-rust-src-path (concat (file-name-as-directory (getenv "HOME")) "dev/rust/rust/src/")) -
sile revised this gist
Jun 6, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ 2017年6月時点のRustの開発環境等メモ =================================== 注意 @@ -9,8 +9,8 @@ インストール ----------- - https://www.rustup.rs/ に記載の方法で必要なツールの一式が入る - バージョンは最新の安定版を使用 参考資料 -------- -
sile revised this gist
Jun 6, 2017 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,12 @@ - 特に最新動向を追ったりはしていないので、情報が古い可能性はある インストール ----------- - https://www.rustup.rs/ - 最新の安定版を使用 参考資料 -------- -
sile revised this gist
Jun 6, 2017 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -109,6 +109,7 @@ Emacs - https://github.com/kbknapp/clap-rs - コマンドライン引数パーサ - 凄く多機能、かつ、直観的に使えて便利 - exampleコマンド(`crate-root/examples/*.rs`)が凄く簡単に作れる - slog: - https://github.com/slog-rs/slog - ロガー @@ -132,7 +133,12 @@ Emacs - futures: - いわゆる`Future` - 非同期I/O系のプログラミングをするなら事実上必須 - `futures`は「非同期I/O処理の記述」を行うのみなので、実際に実行するには別のライブラリが必要 - 良く使うのは[fibers](https://github.com/dwango/fibers-rs) - tokioの方がメジャー - その他: - byteorder, rand, num, etc リリース -------- -
sile revised this gist
Jun 6, 2017 . 1 changed file with 31 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,9 @@ - https://danielkeep.github.io/tlborm/book/README.html - マクロ周りの解説 - 読みたい - http://doc.crates.io/guide.html - Cargoのドキュメント - Cargoは結構多機能なので、ドキュメントには一通り目を通しておくと便利 インストールしているコマンド ---------------------------- @@ -103,22 +105,41 @@ Emacs 良く使うライブラリ ------------------ - clap: - https://github.com/kbknapp/clap-rs - コマンドライン引数パーサ - 凄く多機能、かつ、直観的に使えて便利 - slog: - https://github.com/slog-rs/slog - ロガー - https://crates.io/crates/log の方が標準的っぽくはあるけど、slogの方が設計思想的に好み - slogを手軽に扱えるようにするための軽いライブラリ: https://github.com/sile/sloggers - trackable: - 主にエラーハンドリング用のライブラリ - Rustでのエラーハンドリング自体に関しては[Rustbook](https://doc.rust-lang.org/book/error-handling.html)が詳しい - `try!`や`?`を、ほぼそのまま置き換えるイメージ - 一例として`track_try!`というマクロを提供している - `try!`等と異なるのは、エラー発生地点までのトレース情報が付与されること - また、異なる`Error`トレイト実装間の相互変換も容易になるようにしている - https://github.com/brson/error-chain の方がメジャー - serde: - https://github.com/serde-rs/serde - シリアライズライブラリ - `serde_derive`と組み合わせることで`#[derive(Serialize, Deserialize)]`と書くだけで、たいていのデータ構造がシリアライズ可能になるので便利 - 設定ファイルの読み込み処理や、ネットワークを跨いだデータ転送時のデータ変換処理等を自前で書かなくても良くなる - 少し複雑な設定をコマンドに指定したいなら、clapではなく、serde+tomlを使った方が楽 - [serdeconv](https://github.com/sile/serdeconv)でTOML/JSON/MessagePackに関する変換を手軽に行える - futures: - いわゆる`Future` - 非同期I/O系のプログラミングをするなら事実上必須 リリース -------- - https://crates.io/ にアカウントを登録して`cargo publish`でリリース(パッケージ登録)が可能 - `Cargo.toml`ファイルの参考: https://github.com/sile/libflate/blob/master/Cargo.toml - crates.ioにpublishすると自動で `https://docs.rs/` にも(バージョン毎の)ドキュメントを生成してくれる - 例: https://docs.rs/libflate/ - バイナリのcrateを登録した場合には`cargo install CRATE_NAME`でインストールが可能になる その他 -
sile revised this gist
Jun 6, 2017 . 1 changed file with 24 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,6 +24,7 @@ - マクロ周りの解説 - 読みたい インストールしているコマンド ---------------------------- @@ -90,7 +91,6 @@ Emacs (add-hook 'racer-mode-hook #'eldoc-mode) (add-hook 'racer-mode-hook #'company-mode) (add-hook 'rust-mode-hook '(lambda () (local-set-key (kbd "TAB") #'company-indent-or-complete-common))) @@ -100,8 +100,30 @@ Emacs (setq compilation-ask-about-save nil) ``` 良く使うライブラリ ------------------ - clap - slog - log の方が標準的な立ち位置 - trackable - https://github.com/brson/error-chain の方がメジャー - futures - serde - serde_derive - serdeconv リリース -------- - https://crates.io/ にアカウントを登録して`cargo publish`でリリース(パッケージ登録)が可能 - `Cargo.toml`ファイルの参考: https://github.com/sile/libflate/blob/master/Cargo.toml - crates.ioにpublishすると自動で `https://docs.rs/` にもドキュメントを生成してくれる - バイナリのcrateを登録した場合には`cargo install CRATE_NAME`でインストールが可能になる その他 ------ - `crateルート/examples/*.rs`のファイル群は`caro run --example FILENAME`で実行可能 - コードカバレッジ計測: - kcovを使えば一応可能 -
sile created this gist
Jun 6, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,107 @@ 2017年6月時点のRustの開発環境等メモ =================================== 注意 ---- - 特に最新動向を追ったりはしていないので、情報が古い可能性はある 参考資料 -------- - https://doc.rust-lang.org/book/ - 公式のRustの解説ドキュメント - とりあえずこれを読んでおけば大丈夫感がある - 物足りないなら http://rustbyexample.com/ も読んでも良い - https://doc.rust-lang.org/nomicon/ - unsafeなRustを書くなら必読 - そして、効率的なデータ構造を実装したかったり、低レイヤー寄りの実装をしたいならunsafeなRustはほぼ必須 - https://aturon.github.io/README.html - スタイルガイドライン - 名前付けとか良いお作法とかいろいろと参考になる - 関連(未読): https://github.com/brson/rust-api-guidelines - https://danielkeep.github.io/tlborm/book/README.html - マクロ周りの解説 - 読みたい インストールしているコマンド ---------------------------- ```console # フォーマッタ $ cargo install rustfmt # コード補完とか諸々 $ cargo install racer # 高速grep $ cargo install ripgrep # Rustコード片のお手軽実行用 # (https://github.com/DanielKeep/cargo-script の方がメジャー) $ cargo install evalrs # `cargo install-update -a`で、インストール済みライブラリ群を一括更新してくれる $ cargo install cargo-update ``` Emacs ----- ### インストールパッケージ ```lisp (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (package-initialize) (package-refresh-contents) ;; Rustモード (package-install 'rust-mode) ;; Cargoモード ;; ;; 以下を良く使う: ;; - テスト実行: ;; - Ctrl-K + Ctrl-C + Ctrl-T ;; - チェックビルド: ;; - Ctrl-C + Ctrl-C + Ctrl-K ;; - バイナリを生成しないので高速 ;; - ドキュメントオープン: ;; - Ctrl-C + Ctrl-C + Ctrl-V ;; - ドキュメント生成: ;; - Ctrl-C + Ctrl-C + Ctrl-D (package-install 'cargo) ;; コード補完とか定義元に飛んだりとか (package-install 'racer) (package-install 'company-racer) ``` ### .emacs ```lisp (add-hook 'rust-mode-hook #'cargo-minor-mode) (add-hook 'rust-mode-hook #'racer-mode) ;; ファイル保存時に常にrustfmtを適用 (add-hook 'rust-mode-hook #'rust-enable-format-on-save) (add-hook 'racer-mode-hook #'eldoc-mode) (add-hook 'racer-mode-hook #'company-mode) (add-hook 'rust-mode-hook '(lambda () (local-set-key (kbd "TAB") #'company-indent-or-complete-common))) (setq company-tooltip-align-annotations t) (setq racer-rust-src-path (concat (file-name-as-directory (getenv "HOME")) "dev/rust/rust/src/")) (setq compilation-ask-about-save nil) ``` リリース -------- その他 ------