Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit 2f23a54

Browse files
committed
assorted changes
1 parent 53786e2 commit 2f23a54

File tree

9 files changed

+24
-13
lines changed

9 files changed

+24
-13
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ jobs:
8686
runs-on: ubuntu-latest
8787
env:
8888
ACTION: test-protoc-plugin
89+
PROTOBUF_VERSION: 3.1.0
8990
steps:
9091
- name: cargo cache
9192
uses: actions/cache@v2

.rustfmt.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
imports_granularity = "Item"

ci-gen/src/main.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
use std::fs;
2-
use std::path::Path;
3-
1+
use gh_actions_gen::actions::cargo_cache;
2+
use gh_actions_gen::actions::cargo_doc;
43
use gh_actions_gen::actions::cargo_test;
54
use gh_actions_gen::actions::checkout_sources;
65
use gh_actions_gen::actions::rust_install_toolchain;
76
use gh_actions_gen::actions::RustToolchain;
8-
use gh_actions_gen::actions::{cargo_cache, cargo_doc};
97
use gh_actions_gen::ghwf::Env;
108
use gh_actions_gen::ghwf::Job;
119
use gh_actions_gen::ghwf::Step;
@@ -43,6 +41,10 @@ fn install_protobuf_step() -> Step {
4341
Step::run("install protobuf", "./ci/install-protobuf.sh")
4442
}
4543

44+
fn protobuf_version_env() -> (String, String) {
45+
("PROTOBUF_VERSION".to_owned(), "3.1.0".to_owned())
46+
}
47+
4648
fn cargo_doc_job() -> Job {
4749
let os = LINUX;
4850
let mut steps = Vec::new();
@@ -54,7 +56,7 @@ fn cargo_doc_job() -> Job {
5456
id: "cargo-doc".to_owned(),
5557
name: "cargo doc".to_owned(),
5658
runs_on: os.ghwf,
57-
env: vec![("PROTOBUF_VERSION".to_owned(), "3.1.0".to_owned())],
59+
env: vec![protobuf_version_env()],
5860
steps,
5961
..Default::default()
6062
}
@@ -69,7 +71,10 @@ fn test_protoc_plugin_job() -> Job {
6971
Job {
7072
id: "test-protoc-plugin".to_owned(),
7173
name: "test-protoc-plugin".to_owned(),
72-
env: vec![("ACTION".to_owned(), "test-protoc-plugin".to_owned())],
74+
env: vec![
75+
("ACTION".to_owned(), "test-protoc-plugin".to_owned()),
76+
protobuf_version_env(),
77+
],
7378
steps,
7479
..Default::default()
7580
}

ci/run.sh

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -ex
44

5-
export PROTOBUF_VERSION=3.1.0
6-
75
rustc --version
86

97
export RUST_BACKTRACE=1

grpc/src/client/req_sink.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use crate::client::types::ClientTypes;
2+
use crate::common::sink::MessageToBeSerialized;
3+
use crate::common::sink::SinkCommon;
24
use crate::common::sink::SinkCommonUntyped;
35
use crate::common::sink::SinkUntyped;
4-
use crate::common::sink::{MessageToBeSerialized, SinkCommon};
56

67
use crate::result;
78
use futures::task::Context;

grpc/src/server/method.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ use std::sync::Arc;
22

33
use crate::common::sink::SinkCommon;
44

5+
use crate::method::GrpcStreaming;
6+
use crate::method::GrpcStreamingBidi;
57
use crate::method::GrpcStreamingClientStreaming;
68
use crate::method::GrpcStreamingFlavor;
79
use crate::method::GrpcStreamingServerStreaming;
810
use crate::method::GrpcStreamingUnary;
911
use crate::method::MethodDescriptor;
10-
use crate::method::{GrpcStreaming, GrpcStreamingBidi};
1112
use crate::or_static::arc::ArcOrStatic;
1213
use crate::or_static::string::StringOrStatic;
1314
use crate::result;

grpc/src/server/resp_sink_untyped.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
use crate::common::sink::MessageToBeSerialized;
2+
use crate::common::sink::SinkCommonUntyped;
13
use crate::common::sink::SinkUntyped;
2-
use crate::common::sink::{MessageToBeSerialized, SinkCommonUntyped};
34

45
use crate::proto::grpc_status::GrpcStatus;
56
use crate::proto::headers::headers_200;

grpc/tests/simple.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use grpc::rt::*;
1111
use grpc::*;
1212

1313
use futures::executor;
14-
use futures::{future, TryFutureExt, TryStreamExt};
14+
use futures::future;
15+
use futures::TryFutureExt;
16+
use futures::TryStreamExt;
1517
use std::thread;
1618
use test_misc::*;
1719

protoc-rust-grpc/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use std::fs;
99
use std::io;
1010
use std::io::Read;
1111
use std::io::Write;
12-
use std::path::{Path, PathBuf};
12+
use std::path::Path;
13+
use std::path::PathBuf;
1314

1415
/// Error type alias.
1516
pub type Error = io::Error;

0 commit comments

Comments
 (0)