Skip to content

Add std implementation links to docs #8

@emesare

Description

@emesare

It would be nice to have links to every rust std api used directly within the docs for the api.

For example:

rhai-fs/src/path.rs

Lines 14 to 22 in 896ea06

/// Returns path to current working directory.
///
/// Throws an exception when:
/// - The current working directory does not exist.
/// - The process lacks the permissions to access the current working directory.
#[rhai_fn(return_raw)]
pub fn cwd() -> Result<std::path::PathBuf, Box<EvalAltResult>> {
std::env::current_dir().map_err(|e| e.to_string().into())
}

Becomes:

/// Returns path to current working directory. 
/// 
/// Throws an exception when: 
/// - The current working directory does not exist. 
/// - The process lacks the permissions to access the current working directory. 
///
/// See [std::env::current_dir](https://doc.rust-lang.org/std/env/fn.current_dir.html) for more information.
#[rhai_fn(return_raw)] 
pub fn cwd() -> Result<std::path::PathBuf, Box<EvalAltResult>> { 
   std::env::current_dir().map_err(|e| e.to_string().into()) 
} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions