即使 src/main.rs 可用,cargo 也不会构建
cargo would not build even when src/main.rs is available
我正在尝试使用 cargo build 进行构建。以下是项目结构
tree
.
├── Cargo.toml
└── src
└── main.rs
Cargo.toml的内容
[package]
name = "server"
version = "0.1.0"
authors = ["Lokanath Mohanty <lokanath.mohanty@adcolony.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
src/main.rs
的内容
use std::io::{ErrorKind, Read, Write};
use std::net::TcpListener;
use std::sync::mpsc;
use std::thread;
use std::time::Duration;
const LOCAL_IP: &str = "127.0.0.1:6001";
const MSG_SIZE: usize = 32;
fn main() {
...
}
我收到以下错误 -
error: failed to parse manifest at `/home/debashishc/Downloads/Cargo.toml`
Caused by:
no targets specified in the manifest
either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present
Cargo 寻找并尝试parse Cargo.toml
in parent directories, because it checks whether your crate is part of a larger workspace。
从父目录中删除损坏的 Cargo.toml
。或者,将您的板条箱 Cargo.toml
设为工作区以阻止货物进一步搜索。
我正在尝试使用 cargo build 进行构建。以下是项目结构
tree
.
├── Cargo.toml
└── src
└── main.rs
Cargo.toml的内容
[package]
name = "server"
version = "0.1.0"
authors = ["Lokanath Mohanty <lokanath.mohanty@adcolony.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
src/main.rs
的内容use std::io::{ErrorKind, Read, Write};
use std::net::TcpListener;
use std::sync::mpsc;
use std::thread;
use std::time::Duration;
const LOCAL_IP: &str = "127.0.0.1:6001";
const MSG_SIZE: usize = 32;
fn main() {
...
}
我收到以下错误 -
error: failed to parse manifest at `/home/debashishc/Downloads/Cargo.toml`
Caused by:
no targets specified in the manifest
either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present
Cargo 寻找并尝试parse Cargo.toml
in parent directories, because it checks whether your crate is part of a larger workspace。
从父目录中删除损坏的 Cargo.toml
。或者,将您的板条箱 Cargo.toml
设为工作区以阻止货物进一步搜索。