Skip to content

Update protoc-rust readme #511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions protoc-rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,13 @@ API to generate `.rs` files to be used e. g. [from build.rs](https://github.com/

Example code:

Using stable rust-protobuf:

```rust
extern crate protoc_rust;

use protoc_rust::Customize;

fn main() {
protoc_rust::run(protoc_rust::Args {
out_dir: "src/protos",
input: &["protos/a.proto", "protos/b.proto"],
includes: &["protos"],
customize: Customize {
..Default::default()
},
}).expect("protoc");
}
```

Using rust-protobuf from master:

```rust
extern crate protoc_rust;

use protoc_rust::Customize;

fn main() {
protoc_rust::Args::new()
protoc_rust::Codegen::new()
.out_dir("src/protos")
.inputs(&["protos/a.proto", "protos/b.proto"])
.include("protos")
Expand Down