Skip to content

Commit b054a1d

Browse files
cjlongoriafacebook-github-bot
authored andcommitted
applying rustfix to fbcode
Summary: applying code changes to be compatible with both 2021 and 2024 rust edition Reviewed By: dtolnay Differential Revision: D75237176 fbshipit-source-id: fb07f92e0f156da362061b3940b9a1cd30e312c4
1 parent dde44b4 commit b054a1d

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

td_util/src/file_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::path::Path;
1414

1515
use anyhow::Context;
1616

17-
pub fn file_writer(file_path: &Path) -> anyhow::Result<impl Write> {
17+
pub fn file_writer(file_path: &Path) -> anyhow::Result<impl Write + use<>> {
1818
let file = OpenOptions::new()
1919
.write(true)
2020
.create(true)

td_util/src/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn read_file_lines_parallel<T: for<'a> Deserialize<'a> + Send>(
8585
/// Convenience function to avoid unnecessary allocations for when further processing is needed.
8686
pub fn read_file_lines_par_iter<T: for<'a> Deserialize<'a> + Send>(
8787
filename: &Path,
88-
) -> anyhow::Result<impl ParallelIterator<Item = anyhow::Result<T>>> {
88+
) -> anyhow::Result<impl ParallelIterator<Item = anyhow::Result<T>> + use<T>> {
8989
let file = open_file(filename)?;
9090
// 10MB buffer
9191
let rdr = BufReader::with_capacity(BUFFER_SIZE, file);

td_util/src/supertd_events.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ pub fn init(fb: fbinit::FacebookInit) -> ScubaClientGuard {
103103
/// ```
104104
#[macro_export]
105105
macro_rules! scuba {
106-
( event: $event:ident $(, $key:ident : $value:expr)* $(,)? ) => {
106+
( event: $event:ident $(, $key:ident : $value:expr_2021)* $(,)? ) => {
107107
// @oss-disable: $crate::scuba_logger! {event: $event $(, $key : $value)*};
108108
};
109-
( $($key:ident : $value:expr),* $(,)? ) => {
109+
( $($key:ident : $value:expr_2021),* $(,)? ) => {
110110
compile_error!("`event` must be the first field in the `scuba!` macro");
111111
};
112112
}

td_util/src/supertd_events_logger.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ mod linux {
8484
/// ```
8585
#[macro_export]
8686
macro_rules! scuba_logger {
87-
( event: $event:ident $(, $key:ident : $value:expr)* $(,)? ) => {
87+
( event: $event:ident $(, $key:ident : $value:expr_2021)* $(,)? ) => {
8888
let mut builder = $crate::supertd_events_logger::log_entry();
8989
builder.set_event(format!("{:?}", &$crate::supertd_events::Event::$event));
9090
$($crate::scuba_logger! { @SET_FIELD(builder, $key, $value) })*
9191
$crate::supertd_events_logger::log(&builder);
9292
};
93-
( $($key:ident : $value:expr),* $(,)? ) => {
93+
( $($key:ident : $value:expr_2021),* $(,)? ) => {
9494
compile_error!("`event` must be the first field in the `scuba!` macro");
9595
};
96-
( @SET_FIELD ( $builder:ident, event, $value:expr ) ) => {
96+
( @SET_FIELD ( $builder:ident, event, $value:expr_2021 ) ) => {
9797
compile_error!("duplicate `event` field in `scuba!` macro");
9898
};
99-
( @SET_FIELD ( $builder:ident, data, $value:expr ) ) => {{
99+
( @SET_FIELD ( $builder:ident, data, $value:expr_2021 ) ) => {{
100100
use $crate::supertd_events::serde_json::json;
101101
match $crate::supertd_events::serde_json::to_string(&$value) {
102102
Ok(json) => {
@@ -108,13 +108,13 @@ mod linux {
108108
}
109109
}
110110
}};
111-
( @SET_FIELD ( $builder:ident, duration, $value:expr ) ) => {
111+
( @SET_FIELD ( $builder:ident, duration, $value:expr_2021 ) ) => {
112112
$builder.set_duration_ms(::std::time::Duration::as_millis(&$value) as i64);
113113
};
114-
( @SET_FIELD ( $builder:ident, duration_ms, $value:expr ) ) => {
114+
( @SET_FIELD ( $builder:ident, duration_ms, $value:expr_2021 ) ) => {
115115
compile_error!("unrecognized column name in `scuba!` macro: duration_ms (use `duration` instead)");
116116
};
117-
( @SET_FIELD ( $builder:ident, $key:ident, $value:expr ) ) => {
117+
( @SET_FIELD ( $builder:ident, $key:ident, $value:expr_2021 ) ) => {
118118
compile_error!(concat!("unrecognized column name in `scuba!` macro: ", stringify!($key)));
119119
};
120120
}

0 commit comments

Comments
 (0)