1- use std :: { fs , path :: Path } ;
2-
3- use anyhow :: { anyhow , Result } ;
4- use semver :: { Version , VersionReq } ;
5-
6- use crate :: {
7- config :: { Config , Manifest , PackageManager , WithPath } ,
8- VERSION ,
1+ use {
2+ crate :: {
3+ config :: { Config , Manifest , PackageManager , WithPath } ,
4+ VERSION ,
5+ } ,
6+ anyhow :: { anyhow , Result } ,
7+ semver :: { Version , VersionReq } ,
8+ std :: { fs , path :: Path } ,
99} ;
1010
1111/// Check whether `overflow-checks` codegen option is enabled.
@@ -18,10 +18,8 @@ pub fn check_overflow(cargo_toml_path: impl AsRef<Path>) -> Result<bool> {
1818 . as_ref ( )
1919 . and_then ( |profile| profile. overflow_checks )
2020 . ok_or ( anyhow ! (
21- "`overflow-checks` is not enabled. To enable, add:\n \n \
22- [profile.release]\n \
23- overflow-checks = true\n \n \
24- in workspace root Cargo.toml",
21+ "`overflow-checks` is not enabled. To enable, \
22+ add:\n \n [profile.release]\n overflow-checks = true\n \n in workspace root Cargo.toml",
2523 ) )
2624}
2725
@@ -48,11 +46,8 @@ pub fn check_anchor_version(cfg: &WithPath<Config>) -> Result<()> {
4846 if let Some ( ver) = mismatched_lang_version {
4947 eprintln ! (
5048 "WARNING: `anchor-lang` version({ver}) and the current CLI version({cli_version}) \
51- don't match.\n \n \t \
52- This can lead to unwanted behavior. To use the same CLI version, add:\n \n \t \
53- [toolchain]\n \t \
54- anchor_version = \" {ver}\" \n \n \t \
55- to Anchor.toml\n "
49+ don't match.\n \n \t This can lead to unwanted behavior. To use the same CLI version, \
50+ add:\n \n \t [toolchain]\n \t anchor_version = \" {ver}\" \n \n \t to Anchor.toml\n "
5651 ) ;
5752 }
5853
@@ -78,10 +73,9 @@ pub fn check_anchor_version(cfg: &WithPath<Config>) -> Result<()> {
7873 } ;
7974
8075 eprintln ! (
81- "WARNING: `@anchor-lang/core` version({ver}) and the current CLI version\
82- ({cli_version}) don't match.\n \n \t \
83- This can lead to unwanted behavior. To fix, upgrade the package by running:\n \n \t \
84- {update_cmd} @anchor-lang/core@{cli_version}\n "
76+ "WARNING: `@anchor-lang/core` version({ver}) and the current CLI \
77+ version({cli_version}) don't match.\n \n \t This can lead to unwanted behavior. To fix, \
78+ upgrade the package by running:\n \n \t {update_cmd} @anchor-lang/core@{cli_version}\n "
8579 ) ;
8680 }
8781
@@ -135,11 +129,10 @@ pub fn check_deps(cfg: &WithPath<Config>) -> Result<()> {
135129 } )
136130 . for_each ( |man| {
137131 eprintln ! (
138- "WARNING: Adding `solana-program` as a separate dependency might cause conflicts.\n \
139- To solve, remove the `solana-program` dependency and use the exported crate from \
140- `anchor-lang`.\n \
141- `use solana_program` becomes `use anchor_lang::solana_program`.\n \
142- Program name: `{}`\n ",
132+ "WARNING: Adding `solana-program` as a separate dependency might cause \
133+ conflicts.\n To solve, remove the `solana-program` dependency and use the \
134+ exported crate from `anchor-lang`.\n `use solana_program` becomes `use \
135+ anchor_lang::solana_program`.\n Program name: `{}`\n ",
143136 man. package( ) . name( )
144137 )
145138 } ) ;
@@ -187,12 +180,10 @@ in `{manifest_path:?}`."#
187180 . filter ( |( _, dep) | dep. req_features ( ) . contains ( & "idl-build" . into ( ) ) )
188181 . for_each ( |( name, _) | {
189182 eprintln ! (
190- "WARNING: `idl-build` feature of crate `{name}` is enabled by default. \
191- This is not the intended usage.\n \n \t \
192- To solve, do not enable the `idl-build` feature and include crates that have \
193- `idl-build` feature in the `idl-build` feature list:\n \n \t \
194- [features]\n \t \
195- idl-build = [\" {name}/idl-build\" , ...]\n "
183+ "WARNING: `idl-build` feature of crate `{name}` is enabled by default. This is \
184+ not the intended usage.\n \n \t To solve, do not enable the `idl-build` feature and \
185+ include crates that have `idl-build` feature in the `idl-build` feature \
186+ list:\n \n \t [features]\n \t idl-build = [\" {name}/idl-build\" , ...]\n "
196187 )
197188 } ) ;
198189
@@ -205,11 +196,10 @@ in `{manifest_path:?}`."#
205196 . unwrap_or_default ( )
206197 . then ( || {
207198 eprintln ! (
208- "WARNING: `idl-build` feature of `anchor-spl` is not enabled. \
209- This is likely to result in cryptic compile errors.\n \n \t \
210- To solve, add `anchor-spl/idl-build` to the `idl-build` feature list:\n \n \t \
211- [features]\n \t \
212- idl-build = [\" anchor-spl/idl-build\" , ...]\n "
199+ "WARNING: `idl-build` feature of `anchor-spl` is not enabled. This is likely to \
200+ result in cryptic compile errors.\n \n \t To solve, add `anchor-spl/idl-build` to \
201+ the `idl-build` feature list:\n \n \t [features]\n \t idl-build = \
202+ [\" anchor-spl/idl-build\" , ...]\n "
213203 )
214204 } ) ;
215205
0 commit comments