Skip to content

Commit

Permalink
rustfmt: group_imports = "StdExternalCrate"
Browse files Browse the repository at this point in the history
High time we stop debating this; let the robots do the work.
  • Loading branch information
tamird committed Sep 27, 2023
1 parent 6786383 commit d16e607
Show file tree
Hide file tree
Showing 87 changed files with 215 additions and 212 deletions.
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/btf_tracepoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ impl BtfTracePoint {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_btf_tracepoint() {
let prog = BtfTracePoint::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/cgroup_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ impl CgroupDevice {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_cgroup_device() {
let prog = CgroupDevice::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/cgroup_skb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ impl CgroupSkb {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn cgroup_skb() {
let prog = CgroupSkb::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/cgroup_sock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ impl CgroupSock {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn cgroup_sock_post_bind4() {
let prog = CgroupSock::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/cgroup_sock_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ impl CgroupSockAddr {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn cgroup_sock_addr_connect4() {
let prog = CgroupSockAddr::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/cgroup_sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ impl CgroupSockopt {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn cgroup_sockopt_getsockopt() {
let prog = CgroupSockopt::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/cgroup_sysctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ impl CgroupSysctl {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_cgroup_sysctl() {
let prog = CgroupSysctl::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/fentry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ impl FEntry {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_fentry() {
let prog = FEntry::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/fexit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ impl FExit {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_fexit() {
let prog = FExit::parse(
Expand Down
4 changes: 2 additions & 2 deletions aya-bpf-macros/src/kprobe.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::borrow::Cow;

use proc_macro2::TokenStream;

use quote::quote;
use syn::{ItemFn, Result};

Expand Down Expand Up @@ -79,9 +78,10 @@ impl KProbe {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_kprobe() {
let kprobe = KProbe::parse(
Expand Down
3 changes: 1 addition & 2 deletions aya-bpf-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ use sk_msg::SkMsg;
use sk_skb::{SkSkb, SkSkbKind};
use sock_ops::SockOps;
use socket_filter::SocketFilter;
use uprobe::{UProbe, UProbeKind};

use tc::SchedClassifier;
use tracepoint::TracePoint;
use uprobe::{UProbe, UProbeKind};
use xdp::Xdp;
#[proc_macro_error]
#[proc_macro_attribute]
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/lsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ impl Lsm {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_lsm_sleepable() {
let prog = Lsm::parse(
Expand Down
7 changes: 3 additions & 4 deletions aya-bpf-macros/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ use std::borrow::Cow;

use proc_macro2::TokenStream;
use quote::quote;
use syn::Result;
use syn::{ItemStatic, Result};

use crate::args::name_arg;

use syn::ItemStatic;
pub(crate) struct Map {
item: ItemStatic,
name: String,
Expand Down Expand Up @@ -34,9 +32,10 @@ impl Map {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_map_with_name() {
let map = Map::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/perf_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ impl PerfEvent {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_perf_event() {
let prog = PerfEvent::parse(
Expand Down
4 changes: 2 additions & 2 deletions aya-bpf-macros/src/raw_tracepoint.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::borrow::Cow;

use proc_macro2::TokenStream;

use quote::quote;
use syn::{ItemFn, Result};

Expand Down Expand Up @@ -45,9 +44,10 @@ impl RawTracePoint {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_raw_tracepoint() {
let prog = RawTracePoint::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/sk_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ impl SkLookup {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_sk_lookup() {
let prog = SkLookup::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/sk_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ impl SkMsg {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_sk_msg() {
let prog = SkMsg::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/sk_skb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ impl SkSkb {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_stream_parser() {
let prog = SkSkb::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/sock_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ impl SockOps {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_sock_ops() {
let prog = SockOps::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/socket_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ impl SocketFilter {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_socket_filter() {
let prog = SocketFilter::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/tc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ impl SchedClassifier {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_sched_classifier() {
let prog = SchedClassifier::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/tracepoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ impl TracePoint {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_tracepoint() {
let prog = TracePoint::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/uprobe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ impl UProbe {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn uprobe() {
let uprobe = UProbe::parse(
Expand Down
3 changes: 2 additions & 1 deletion aya-bpf-macros/src/xdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ impl Xdp {

#[cfg(test)]
mod tests {
use super::*;
use syn::parse_quote;

use super::*;

#[test]
fn test_xdp() {
let prog = Xdp::parse(
Expand Down
5 changes: 2 additions & 3 deletions aya-log-ebpf-macros/src/expand.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use aya_log_common::DisplayHint;
use aya_log_parser::{parse, Fragment};
use proc_macro2::TokenStream;
use quote::quote;
use syn::{
Expand All @@ -6,9 +8,6 @@ use syn::{
Error, Expr, LitStr, Result, Token,
};

use aya_log_common::DisplayHint;
use aya_log_parser::{parse, Fragment};

pub(crate) struct LogArgs {
pub(crate) ctx: Expr,
pub(crate) target: Option<Expr>,
Expand Down
16 changes: 8 additions & 8 deletions aya-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ use std::{

const MAP_NAME: &str = "AYA_LOGS";

use aya_log_common::{
Argument, DisplayHint, Level, LogValueLength, RecordField, LOG_BUF_CAPACITY, LOG_FIELDS,
};
use bytes::BytesMut;
use log::{error, Log, Record};
use thiserror::Error;

use aya::{
maps::{
perf::{AsyncPerfEventArray, Events, PerfBufferError},
Expand All @@ -74,6 +67,12 @@ use aya::{
util::online_cpus,
Bpf, Pod,
};
use aya_log_common::{
Argument, DisplayHint, Level, LogValueLength, RecordField, LOG_BUF_CAPACITY, LOG_FIELDS,
};
use bytes::BytesMut;
use log::{error, Log, Record};
use thiserror::Error;

#[derive(Copy, Clone)]
#[repr(transparent)]
Expand Down Expand Up @@ -563,10 +562,11 @@ fn try_read<T: Pod>(mut buf: &[u8]) -> Result<(T, &[u8], &[u8]), ()> {

#[cfg(test)]
mod test {
use super::*;
use aya_log_common::{write_record_header, WriteToBuf};
use log::{logger, Level};

use super::*;

fn new_log(args: usize) -> Option<(usize, Vec<u8>)> {
let mut buf = vec![0; 8192];
let len = write_record_header(
Expand Down

0 comments on commit d16e607

Please sign in to comment.