Sign in
fuchsia
/
third_party
/
github.com
/
rust-lang
/
rust-analyzer
/
520054681ab50fa3c6c5cf9fb638ef8c0db3fd24
/
.
/
crates
/
ra-salsa
/
tests
/
incremental
/
counter.rs
blob: c04857e24c9e87d8b08ee9812418b341988aede4 [
file
] [
log
] [
blame
]
use
std
::
cell
::
Cell
;
#[
derive
(
Default
)]
pub
(
crate
)
struct
Counter
{
value
:
Cell
<
usize
>,
}
impl
Counter
{
pub
(
crate
)
fn
increment
(&
self
)
->
usize
{
let
v
=
self
.
value
.
get
();
self
.
value
.
set
(
v
+
1
);
v
}
}