@@ -3,13 +3,13 @@ use std::fmt;
33use std:: sync:: { Arc , RwLock } ;
44
55#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
6- pub enum Severity {
6+ pub ( crate ) enum Severity {
77 Warning ,
88 Error ,
99}
1010
1111#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
12- pub enum IssueType {
12+ pub ( crate ) enum IssueType {
1313 NoGpu , // GPU required for compute
1414 DockerNotInstalled , // Docker required for containers
1515 ContainerToolkitNotInstalled , // Container toolkit required for GPU
@@ -22,7 +22,7 @@ pub enum IssueType {
2222}
2323
2424impl IssueType {
25- pub const fn severity ( & self ) -> Severity {
25+ pub ( crate ) const fn severity ( & self ) -> Severity {
2626 match self {
2727 Self :: NetworkConnectivityIssue
2828 | Self :: InsufficientCpu
@@ -38,24 +38,24 @@ impl IssueType {
3838}
3939
4040#[ derive( Debug , Clone ) ]
41- pub struct Issue {
41+ pub ( crate ) struct Issue {
4242 issue_type : IssueType ,
4343 message : String ,
4444}
4545
4646impl Issue {
47- pub fn new ( issue_type : IssueType , message : impl Into < String > ) -> Self {
47+ pub ( crate ) fn new ( issue_type : IssueType , message : impl Into < String > ) -> Self {
4848 Self {
4949 issue_type,
5050 message : message. into ( ) ,
5151 }
5252 }
5353
54- pub const fn severity ( & self ) -> Severity {
54+ pub ( crate ) const fn severity ( & self ) -> Severity {
5555 self . issue_type . severity ( )
5656 }
5757
58- pub fn print ( & self ) {
58+ pub ( crate ) fn print ( & self ) {
5959 match self . severity ( ) {
6060 Severity :: Error => Console :: user_error ( & format ! ( "{self}" ) ) ,
6161 Severity :: Warning => Console :: warning ( & format ! ( "{self}" ) ) ,
@@ -70,22 +70,22 @@ impl fmt::Display for Issue {
7070}
7171
7272#[ derive( Debug , Default , Clone ) ]
73- pub struct IssueReport {
73+ pub ( crate ) struct IssueReport {
7474 issues : Arc < RwLock < Vec < Issue > > > ,
7575}
7676
7777impl IssueReport {
78- pub fn new ( ) -> Self {
78+ pub ( crate ) fn new ( ) -> Self {
7979 Self :: default ( )
8080 }
8181
82- pub fn add_issue ( & self , issue_type : IssueType , message : impl Into < String > ) {
82+ pub ( crate ) fn add_issue ( & self , issue_type : IssueType , message : impl Into < String > ) {
8383 if let Ok ( mut issues) = self . issues . write ( ) {
8484 issues. push ( Issue :: new ( issue_type, message) ) ;
8585 }
8686 }
8787
88- pub fn print_issues ( & self ) {
88+ pub ( crate ) fn print_issues ( & self ) {
8989 if let Ok ( issues) = self . issues . read ( ) {
9090 if issues. is_empty ( ) {
9191 Console :: success ( "No issues found" ) ;
@@ -104,7 +104,7 @@ impl IssueReport {
104104 }
105105 }
106106
107- pub fn has_critical_issues ( & self ) -> bool {
107+ pub ( crate ) fn has_critical_issues ( & self ) -> bool {
108108 if let Ok ( issues) = self . issues . read ( ) {
109109 return issues
110110 . iter ( )
0 commit comments