Rust Cargo не может найти пакет postgres

У меня это в Cargo.toml

[dependencies.postgres]

git = "https://github.com/sfackler/rust-postgres.git"

Это привело к следующему результату при запуске cargo build:

$ cargo build -u
    Updating git repository `https://github.com/sfackler/rust-postgres.git`
No package named `postgres` found (required by `hello-world`).
Location searched: https://github.com/sfackler/rust-postgres.git
Version required: *

Что мне здесь не хватает?


person bojangle    schedule 31.07.2014    source источник


Ответы (1)


Изменить [dependencies.postgres] [dependencies.rust-postgres]

Причина этого: Cargo.toml этого пакета определяет имя пакета как rust-postgres, и это должно совпадать.

Однако обратите внимание, что он также определяет имя своего lib как просто postgres. Итак, вы бы сделали extern crate postgres; (не extern crate rust-postgres;)

person bguiz    schedule 31.07.2014