Merge pull request #2057 from AleoHQ/fix/readme

Fix readme links and clippy lints
This commit is contained in:
Collin Chin 2022-09-06 16:36:56 +02:00 committed by GitHub
commit 5c706f2888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 14 deletions

View File

@ -95,14 +95,14 @@ Congratulations! You've just run your first Leo program.
## 4. Documentation ## 4. Documentation
* [Hello World - Next Steps](https://developer.aleo.org/developer/getting_started/hello_world) * [Hello World - Next Steps](https://developer.aleo.org/leo/getting_started/hello_world)
* [Leo Language Documentation](https://developer.aleo.org/developer/language/layout) * [Leo Language Documentation](https://developer.aleo.org/leo/getting_started/overview)
* [Leo ABNF Grammar](./docs/grammar/abnf-grammar.txt) * [Leo ABNF Grammar](./docs/grammar/abnf-grammar.txt)
* [Homepage](https://developer.aleo.org/developer/getting_started/overview) * [Homepage](https://developer.aleo.org/overview/)
## 5. Contributing ## 5. Contributing
Please see our guidelines in the [developer documentation](https://developer.aleo.org/developer/additional_material/contributing) Please see our guidelines in the [developer documentation](./CONTRIBUTING.md)
Thank you for helping make Leo better! Thank you for helping make Leo better!

View File

@ -73,7 +73,7 @@ impl InputAst {
/// Serializes the `Input` into a JSON Value. /// Serializes the `Input` into a JSON Value.
pub fn to_json_value(&self) -> Result<serde_json::Value> { pub fn to_json_value(&self) -> Result<serde_json::Value> {
Ok(serde_json::to_value(&self).map_err(|e| AstError::failed_to_convert_ast_to_json_value(&e))?) Ok(serde_json::to_value(self).map_err(|e| AstError::failed_to_convert_ast_to_json_value(&e))?)
} }
/// Serializes the input into a JSON file. /// Serializes the input into a JSON file.

View File

@ -84,7 +84,7 @@ fn hash_content(content: &str) -> String {
} }
fn hash_file(path: &str) -> String { fn hash_file(path: &str) -> String {
let file = fs::read_to_string(&Path::new(path)).unwrap(); let file = fs::read_to_string(Path::new(path)).unwrap();
hash_content(&file) hash_content(&file)
} }
@ -210,7 +210,7 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result<Va
let cwd = test.config.get("cwd").map(|val| { let cwd = test.config.get("cwd").map(|val| {
let mut cwd = test.path.clone(); let mut cwd = test.path.clone();
cwd.pop(); cwd.pop();
cwd.join(&val.as_str().unwrap()) cwd.join(val.as_str().unwrap())
}); });
let mut parsed = handler.extend_if_error(parse_program(handler, &test.content, cwd))?; let mut parsed = handler.extend_if_error(parse_program(handler, &test.content, cwd))?;

View File

@ -142,7 +142,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
// Case where `access.name` is not a member of the circuit. // Case where `access.name` is not a member of the circuit.
None => { None => {
self.emit_err(TypeCheckerError::invalid_circuit_variable( self.emit_err(TypeCheckerError::invalid_circuit_variable(
&access.name, access.name,
&circ, &circ,
access.name.span(), access.name.span(),
)); ));
@ -405,7 +405,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
Some(ret) Some(ret)
} else { } else {
self.emit_err(TypeCheckerError::unknown_sym("function", &ident.name, ident.span())); self.emit_err(TypeCheckerError::unknown_sym("function", ident.name, ident.span()));
None None
} }
} }
@ -451,7 +451,7 @@ impl<'a> ExpressionVisitor<'a> for TypeChecker<'a> {
} else { } else {
self.emit_err(TypeCheckerError::unknown_sym( self.emit_err(TypeCheckerError::unknown_sym(
"circuit", "circuit",
&input.name.name, input.name.name,
input.name.span(), input.name.span(),
)); ));
None None

View File

@ -305,7 +305,7 @@ impl<'a> TypeChecker<'a> {
None => { None => {
// Not a core library circuit. // Not a core library circuit.
self.emit_err(TypeCheckerError::invalid_core_instruction( self.emit_err(TypeCheckerError::invalid_core_instruction(
&ident.name, ident.name,
function.name, function.name,
ident.span(), ident.span(),
)); ));

View File

@ -50,7 +50,7 @@ impl Command for Deploy {
.map_err(|err| PackageError::failed_to_set_cwd(build_directory.display(), err))?; .map_err(|err| PackageError::failed_to_set_cwd(build_directory.display(), err))?;
// Call the `aleo node` command from the Aleo SDK. // Call the `aleo node` command from the Aleo SDK.
let command = AleoDeploy::try_parse_from(&[ALEO_CLI_COMMAND]).map_err(CliError::failed_to_parse_aleo_node)?; let command = AleoDeploy::try_parse_from([ALEO_CLI_COMMAND]).map_err(CliError::failed_to_parse_aleo_node)?;
let res = command.parse().map_err(CliError::failed_to_execute_aleo_node)?; let res = command.parse().map_err(CliError::failed_to_execute_aleo_node)?;
// Log the output of the `aleo node` command. // Log the output of the `aleo node` command.

View File

@ -51,7 +51,7 @@ impl Command for New {
fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> { fn apply(self, context: Context, _: Self::Input) -> Result<Self::Output> {
// Call the `aleo new` command from the Aleo SDK. // Call the `aleo new` command from the Aleo SDK.
let command = let command =
AleoNew::try_parse_from(&[ALEO_CLI_COMMAND, &self.name]).map_err(CliError::failed_to_parse_aleo_new)?; AleoNew::try_parse_from([ALEO_CLI_COMMAND, &self.name]).map_err(CliError::failed_to_parse_aleo_new)?;
let result = command.parse().map_err(CliError::failed_to_execute_aleo_new)?; let result = command.parse().map_err(CliError::failed_to_execute_aleo_new)?;
// todo: modify the readme file to recommend building with `leo build`. // todo: modify the readme file to recommend building with `leo build`.

View File

@ -67,7 +67,7 @@ impl Context {
// Read the manifest file to string. // Read the manifest file to string.
let manifest_string = let manifest_string =
std::fs::read_to_string(&manifest.path()).map_err(PackageError::failed_to_open_manifest)?; std::fs::read_to_string(manifest.path()).map_err(PackageError::failed_to_open_manifest)?;
// Construct the file path. // Construct the file path.
let build_manifest_path = build_path.join(Manifest::<Network>::file_name()); let build_manifest_path = build_path.join(Manifest::<Network>::file_name());