mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Make edition handling a bit nicer and allow specifying edition in crate_graph macro
This commit is contained in:
parent
d5ad38cbb8
commit
70839b7ef8
5 changed files with 28 additions and 25 deletions
|
@ -62,6 +62,15 @@ pub enum Edition {
|
|||
Edition2015,
|
||||
}
|
||||
|
||||
impl Edition {
|
||||
pub fn from_string(s: &str) -> Edition {
|
||||
match s {
|
||||
"2015" => Edition::Edition2015,
|
||||
"2018" | _ => Edition::Edition2018,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
struct CrateData {
|
||||
file_id: FileId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue