Grcov report - use_cargo.rs

1

    use serde::Deserialize;

2

3

    #[derive(Debug, Deserialize)]

4

    pub struct UseCargoArgs {

5

      /// The package manager to use

6

      #[serde(default)]

7

      pub package_manager: String,

8

9

      /// The working directory to run the command in

10

      #[serde(default)]

11

      pub work_dir: Option<String>,

12

    }

13

14

    #[derive(Debug, Deserialize)]

15

    #[serde(untagged)]

16

    pub enum UseCargo {

17

      Bool(bool),

18

      UseCargo(Box<UseCargoArgs>),

19

    }

20

21

    impl UseCargo {

22

      pub fn capture(&self) -> anyhow::Result<()> {

23

        match self {

24

          UseCargo::Bool(true) => self.capture_tasks(),

25

          UseCargo::UseCargo(args) => args.capture_tasks(),

26

          _ => Ok(()),

27

        }

28

      }

29

30

      fn capture_tasks(&self) -> anyhow::Result<()> {

31

        unimplemented!()

32

      }

33

    }

34

35

    impl UseCargoArgs {

36

      pub fn capture_tasks(&self) -> anyhow::Result<()> {

37

        unimplemented!()

38

      }

39

    }