mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-08 17:57:26 -08:00
29 lines
570 B
Go
29 lines
570 B
Go
|
package main
|
||
|
|
||
|
type rust struct {
|
||
|
language *language
|
||
|
}
|
||
|
|
||
|
func (r *rust) string() string {
|
||
|
return r.language.string()
|
||
|
}
|
||
|
|
||
|
func (r *rust) init(props *properties, env environmentInfo) {
|
||
|
r.language = &language{
|
||
|
env: env,
|
||
|
props: props,
|
||
|
extensions: []string{"*.rs", "Cargo.toml", "Cargo.lock"},
|
||
|
commands: []*cmd{
|
||
|
{
|
||
|
executable: "rustc",
|
||
|
args: []string{"--version"},
|
||
|
regex: `rustc (?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+)))`,
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (r *rust) enabled() bool {
|
||
|
return r.language.enabled()
|
||
|
}
|