File: README.md

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (62 lines) | stat: -rw-r--r-- 1,510 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# rustc_tools_util

A small tool to help you generate version information
for packages installed from a git repo

## Usage

Add a `build.rs` file to your repo and list it in `Cargo.toml`
````toml
build = "build.rs"
````

List rustc_tools_util as regular AND build dependency.
````toml
[dependencies]
rustc_tools_util = "0.4.0"

[build-dependencies]
rustc_tools_util = "0.4.0"
````

In `build.rs`, generate the data in your `main()`

```rust
fn main() {
    rustc_tools_util::setup_version_info!();
}
```

Use the version information in your main.rs

```rust
fn show_version() {
    let version_info = rustc_tools_util::get_version_info!();
    println!("{}", version_info);
}
```

This gives the following output in clippy:
`clippy 0.1.66 (a28f3c8 2022-11-20)`

## Repository

This project is part of the rust-lang/rust-clippy repository. The source code
can be found under `./rustc_tools_util/`.

The changelog for `rustc_tools_util` is available under:
[`rustc_tools_util/CHANGELOG.md`](https://github.com/rust-lang/rust-clippy/blob/master/rustc_tools_util/CHANGELOG.md)

## License

<!-- REUSE-IgnoreStart -->

Copyright 2014-2024 The Rust Project Developers

Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
<LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
option. All files in the project carrying such notice may not be
copied, modified, or distributed except according to those terms.

<!-- REUSE-IgnoreEnd -->