You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/elan-cli/json_dump.rs
+20-10Lines changed: 20 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
use elan::{lookup_unresolved_toolchain_desc,resolve_toolchain_desc, utils::{self, fetch_latest_release_tag},Cfg,Toolchain,UnresolvedToolchainDesc};
1
+
use elan::{lookup_unresolved_toolchain_desc,resolve_toolchain_desc_ext, utils::{self, fetch_latest_release_tag},Cfg,Toolchain,UnresolvedToolchainDesc};
2
2
use std::{io, path::PathBuf};
3
3
4
4
use serde_derive::Serialize;
@@ -22,12 +22,20 @@ struct InstalledToolchain {
22
22
path:PathBuf,
23
23
}
24
24
25
+
#[derive(Serialize)]
26
+
structToolchainResolution{
27
+
/// On network error, will always be `Err` even if `elan` commands would fall back to the latest
28
+
/// local toolchain if any
29
+
live:Result<String>,
30
+
/// The latest local toolchain if any independently of network availability
31
+
cached:Option<String>,
32
+
}
33
+
25
34
#[derive(Serialize)]
26
35
structDefaultToolchain{
27
36
/// Not necessarily resolved name as given to `elan default`, e.g. `stable`
28
37
unresolved:UnresolvedToolchainDesc,
29
-
/// Fully resolved name; `Err` if `unresolved` needed to be resolved but there was a network error
30
-
resolved:Result<String>,
38
+
resolved:ToolchainResolution,
31
39
}
32
40
33
41
#[derive(Serialize)]
@@ -44,7 +52,7 @@ struct Toolchains {
44
52
/// `None` if no override for current directory configured, in which case `default` if any is used
45
53
active_override:Option<Override>,
46
54
/// Toolchain, if any, ultimately chosen based on `default` and `active_override`
0 commit comments