Skip to content

Commit

Permalink
Merge pull request #4866 from quodlibetor/update-rust-1.48
Browse files Browse the repository at this point in the history
Update Rust to 1.48
  • Loading branch information
quodlibetor authored Nov 23, 2020
2 parents acd17bd + d059b97 commit b5fb448
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 44 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 7 additions & 16 deletions bin/doc
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,18 @@ cd "$(dirname "$0")/.."

. misc/shlib/shlib.bash

rustup=1
for arg
do
case "$arg" in
--rustup) rustup=1 ;;
--rustup=*) die "--rustup option does not take an argument" ;;
--no-rustup) rustup= ;;
--no-rustup=*) die "--no-rustup option does not take an argument" ;;
-h|--help)
printf "usage: %s\n\nBuild the rust documentation site\n" "$0"
exit 0
;;
-*) die "unknown option $arg" ;;
*) die "usage: $0 [--rustup|--no-rustup]" ;;
*) die "usage: $0" ;;
esac
done

cargo() {
if [[ "$rustup" ]]; then
command cargo +nightly "$@"
else
command cargo "$@"
fi
}

# Use nightly until stable supports intra-Rustdoc links.
# https://github.com/rust-lang/rust/issues/43466
cargo doc

crates=$(cargo metadata --format-version=1 \
Expand Down Expand Up @@ -132,3 +121,5 @@ if (el.href != "index.html") {
el.href = "../index.html";
}
EOF

echo "Docs are in target/doc/index.html"
2 changes: 1 addition & 1 deletion ci/builder/stable.stamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.47.0-20201118-154151
1.48.0-20201123-142044
2 changes: 1 addition & 1 deletion ci/deploy/devsite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

set -euo pipefail

bin/doc --no-rustup
bin/doc
bin/pydoc
rsync misc/www/index.html [email protected]:/var/www/html/index.html
rsync --archive target/doc/ [email protected]:/var/www/html/api/rust
Expand Down
4 changes: 2 additions & 2 deletions play/mbta/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ fn parse_entry(parsed_object: &mut json::JsonValue) -> (String, Option<String>)

fn parse_line(line: &str) -> Result<Vec<(String, Option<String>)>, String> {
let mut results = Vec::new();
if line.starts_with("data: ") {
let mut parsed_json = json::parse(&line[6..]);
if let Some(remainder) = line.strip_prefix("data: ") {
let mut parsed_json = json::parse(remainder);
if let Ok(parsed_json) = &mut parsed_json {
if parsed_json.is_array() {
for member in parsed_json.members_mut() {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.47.0
1.48.0
2 changes: 1 addition & 1 deletion src/avro/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ impl SchemaParser {
"ignore" => Some(RecordFieldOrder::Ignore),
_ => None,
})
.unwrap_or_else(|| RecordFieldOrder::Ascending);
.unwrap_or(RecordFieldOrder::Ascending);

Ok(RecordField {
name,
Expand Down
2 changes: 1 addition & 1 deletion src/materialized/src/http/prof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn flamegraph(
|_node, is_last| {
data_json.borrow_mut().push_str("]}");
if !is_last {
data_json.borrow_mut().push_str(",");
data_json.borrow_mut().push(',');
}
},
);
Expand Down
2 changes: 1 addition & 1 deletion src/materialized/src/http/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Server {
.await;
match res {
Ok(res) => Ok(res),
Err(e) => return Ok(util::error_response(StatusCode::BAD_REQUEST, e.to_string())),
Err(e) => Ok(util::error_response(StatusCode::BAD_REQUEST, e.to_string())),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/repr/src/strconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ pub fn parse_bytes(s: &str) -> Result<Vec<u8>, ParseError> {
//
// [0]: https://www.postgresql.org/docs/current/datatype-binary.html#id-1.5.7.12.9
// [1]: https://www.postgresql.org/docs/current/datatype-binary.html#id-1.5.7.12.10
if s.starts_with("\\x") {
hex::decode(&s[2..]).map_err(|e| ParseError::new("bytea", s).with_details(e))
if let Some(remainder) = s.strip_prefix(r"\x") {
hex::decode(remainder).map_err(|e| ParseError::new("bytea", s).with_details(e))
} else {
parse_bytes_traditional(s)
}
Expand Down
14 changes: 2 additions & 12 deletions src/symbiosis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,7 @@ impl Postgres {
let mut config: tokio_postgres::Config = url.parse()?;
let username = whoami::username();
if config.get_user().is_none() {
config.user(
env::var("PGUSER")
.ok()
.as_deref()
.unwrap_or_else(|| &username),
);
config.user(env::var("PGUSER").ok().as_deref().unwrap_or(&username));
}
if config.get_password().is_none() {
if let Ok(password) = env::var("PGPASSWORD") {
Expand All @@ -75,12 +70,7 @@ impl Postgres {
}
}
if config.get_hosts().is_empty() {
config.host(
env::var("PGHOST")
.ok()
.as_deref()
.unwrap_or_else(|| "localhost"),
);
config.host(env::var("PGHOST").ok().as_deref().unwrap_or("localhost"));
}
let (client, conn) = config
.connect(tokio_postgres::NoTls)
Expand Down
6 changes: 2 additions & 4 deletions src/testdrive/src/action/kinesis/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@ impl Action for IngestAction {
match state.kinesis_client.put_record(put_input.clone()).await {
Ok(_output) => Ok(()),
Err(RusotoError::Service(PutRecordError::ResourceNotFound(err))) => {
return Err(format!("resource not found: {}", err))
}
Err(err) => {
return Err(format!("unable to put Kinesis record: {}", err.to_string()))
Err(format!("resource not found: {}", err))
}
Err(err) => Err(format!("unable to put Kinesis record: {}", err.to_string())),
}
})
.await
Expand Down

0 comments on commit b5fb448

Please sign in to comment.