xref: /aosp_15_r20/external/bazelbuild-rules_rust/test/clippy/src/lib.rs (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)

greeting() -> String1*d4726bddSHONG Yifan pub fn greeting() -> String {
2*d4726bddSHONG Yifan     "Hello World".to_owned()
3*d4726bddSHONG Yifan }
4*d4726bddSHONG Yifan 
5*d4726bddSHONG Yifan // too_many_args/clippy.toml will require no more than 2 args.
with_args(_: u32, _: u32, _: u32)6*d4726bddSHONG Yifan pub fn with_args(_: u32, _: u32, _: u32) {}
7*d4726bddSHONG Yifan 
8*d4726bddSHONG Yifan #[cfg(test)]
9*d4726bddSHONG Yifan mod tests {
10*d4726bddSHONG Yifan     use super::*;
11*d4726bddSHONG Yifan     #[test]
it_works()12*d4726bddSHONG Yifan     fn it_works() {
13*d4726bddSHONG Yifan         assert_eq!(greeting(), "Hello World".to_owned());
14*d4726bddSHONG Yifan     }
15*d4726bddSHONG Yifan }
16