oh-my-posh/src/segment_rust.go

29 lines
569 B
Go
Raw Normal View History

2021-07-04 13:53:10 -07:00
package main
type rust struct {
language *language
}
func (r *rust) string() string {
return r.language.string()
}
2021-11-26 01:37:33 -08:00
func (r *rust) init(props properties, env environmentInfo) {
2021-07-04 13:53:10 -07:00
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()
}