Ban Default::default()

This commit is contained in:
Michael Vines
2019-02-09 09:13:35 -08:00
committed by Grimes
parent da5b777ee7
commit c02625f91a

View File

@ -7,7 +7,7 @@ set -e
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
source ci/_ source ci/_
# please don't print from --lib... # Logging hygiene: Please don't print from --lib, use the `log` crate instead
declare prints=( declare prints=(
'print!' 'print!'
'println!' 'println!'
@ -15,7 +15,16 @@ declare prints=(
'eprintln!' 'eprintln!'
) )
if _ git grep "${prints[@]/#/-e }" src if _ git grep "${prints[@]/#/-e }" src; then
then
exit 1 exit 1
fi fi
# Code readability: please be explicit about the type instead of using
# Default::default()
#
# Ref: https://github.com/solana-labs/solana/issues/2630
if _ git grep 'Default::default()' -- '*.rs'; then
exit 1
fi