File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1+ pub use std:: env:: * ;
2+
3+ pub const PLAYGROUND_GITHUB_TOKEN : & str = "PLAYGROUND_GITHUB_TOKEN" ;
Original file line number Diff line number Diff line change 11#![ deny( rust_2018_idioms) ]
22
3+ use crate :: env:: PLAYGROUND_GITHUB_TOKEN ;
34use serde:: { Deserialize , Serialize } ;
45use snafu:: prelude:: * ;
56use std:: {
67 convert:: TryFrom ,
7- env,
88 net:: SocketAddr ,
99 path:: { Path , PathBuf } ,
1010 sync:: Arc ,
@@ -14,6 +14,7 @@ const DEFAULT_ADDRESS: &str = "127.0.0.1";
1414const DEFAULT_PORT : u16 = 5000 ;
1515
1616mod asm_cleanup;
17+ mod env;
1718mod gist;
1819mod metrics;
1920mod sandbox;
@@ -54,7 +55,6 @@ impl Config {
5455 . and_then ( |p| p. parse ( ) . ok ( ) )
5556 . unwrap_or ( DEFAULT_PORT ) ;
5657
57- const PLAYGROUND_GITHUB_TOKEN : & str = "PLAYGROUND_GITHUB_TOKEN" ;
5858 let gh_token = env:: var ( PLAYGROUND_GITHUB_TOKEN ) . ok ( ) ;
5959 if gh_token. is_none ( ) {
6060 log:: warn!( "Environment variable {} is not set, so reading and writing GitHub gists will not work" , PLAYGROUND_GITHUB_TOKEN ) ;
@@ -149,7 +149,7 @@ pub enum Error {
149149 GistCreation { source : octocrab:: Error } ,
150150 #[ snafu( display( "Gist loading failed: {}" , source) ) ]
151151 GistLoading { source : octocrab:: Error } ,
152- #[ snafu( display( "PLAYGROUND_GITHUB_TOKEN not set up for reading/writing gists" ) ) ]
152+ #[ snafu( display( "{ PLAYGROUND_GITHUB_TOKEN} not set up for reading/writing gists" ) ) ]
153153 NoGithubToken ,
154154 #[ snafu( display( "Unable to serialize response: {}" , source) ) ]
155155 Serialization { source : serde_json:: Error } ,
You can’t perform that action at this time.
0 commit comments