File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,28 @@ pub enum ErrFromEnv {
167167 } ,
168168}
169169
170+ impl std:: fmt:: Display for ErrFromEnv {
171+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
172+ match self {
173+ ErrFromEnv :: IsNotConfigured => {
174+ write ! ( f, "couldn't find relevant environment variable" )
175+ }
176+ ErrFromEnv :: PlatformSpecific { err, env, var } => {
177+ write ! ( f, "{err} ({env}={var}" )
178+ }
179+ }
180+ }
181+ }
182+
183+ impl std:: error:: Error for ErrFromEnv {
184+ fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
185+ match self {
186+ ErrFromEnv :: IsNotConfigured => None ,
187+ ErrFromEnv :: PlatformSpecific { err, .. } => Some ( err) ,
188+ }
189+ }
190+ }
191+
170192impl Client {
171193 /// Creates a new jobserver initialized with the given parallelism limit.
172194 ///
You can’t perform that action at this time.
0 commit comments