Skip to content

missing anyhow #1754

@Gelei88

Description

@Gelei88

Description
The official "Getting Started" documentation provides a code example that uses the anyhow::Error type, but the accompanying sample Cargo.toml file in the same guide is missing the anyhow dependency.

This oversight causes a compilation error (E0433: failed to resolve: use of unresolved module or unlinked crate \anyhow) for users who copy the provided code and Cargo.toml, particularly those new to Rust, leading to unnecessary confusion and time spent resolving a dependency issue.

Environment
GPUI: N/A (Documentation issue)

GPUI Component: N/A (Documentation issue)

Platform: Any (The issue is in the documentation content)

Steps to Reproduce
Go to the official documentation page: https://longbridge.github.io/gpui-component/docs/getting-started.

Copy the sample Cargo.toml dependencies provided in the guide.

Copy the sample Rust code snippet, specifically the line: Ok::<_, anyhow::Error>(()).

Attempt to run cargo build.

See error: error[E0433]: failed to resolve: use of unresolved module or unlinked crate \anyhow``

Screenshots
Not applicable as the issue is a text omission in the code block.

Expected
The sample Cargo.toml in the "Getting Started" guide should explicitly include anyhow under [dependencies].

Expected Cargo.toml snippet:

Ini, TOML

[dependencies]
gpui = { git = "https://github.com/longbridge/gpui.git", rev = "..." }
anyhow = "1.0" # <--- This line should be present
Actual
The sample Cargo.toml dependencies currently omit the anyhow crate.

Actual Cargo.toml snippet:

Ini, TOML

[dependencies]
gpui = { git = "https://github.com/longbridge/gpui.git", rev = "..." }

'anyhow' dependency is missing here, despite being used in the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions