Docs rewrite
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: Attributes
|
||||
description: Inner and outer attributes for modules, items, and metadata.
|
||||
icon: Hash
|
||||
---
|
||||
|
||||
Inner attributes apply to the containing module:
|
||||
|
||||
```mist
|
||||
#![allow(unused_variables)]
|
||||
```
|
||||
|
||||
Outer attributes apply to the next item:
|
||||
|
||||
```mist
|
||||
#[derive(Debug, Clone)]
|
||||
struct Point {
|
||||
i32 x,
|
||||
i32 y,
|
||||
}
|
||||
|
||||
#[test]
|
||||
void my_test()
|
||||
{
|
||||
assert_eq!(1, 1);
|
||||
}
|
||||
```
|
||||
|
||||
Attribute syntax:
|
||||
- `#[path]`
|
||||
- `#[path = literal]`
|
||||
- `#[path(item1, item2, ...)]`
|
||||
Reference in New Issue
Block a user