Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Web Instant
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Web Instant
Commits
eccb3d31
Verified
Commit
eccb3d31
authored
2 years ago
by
Louis
Browse files
Options
Downloads
Patches
Plain Diff
Fix lints
parent
a20f3297
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/instant_desktop.rs
+2
-1
2 additions, 1 deletion
src/instant_desktop.rs
src/lib.rs
+1
-1
1 addition, 1 deletion
src/lib.rs
with
3 additions
and
2 deletions
src/instant_desktop.rs
+
2
−
1
View file @
eccb3d31
...
@@ -2,6 +2,7 @@ use std::fmt::{Debug, Formatter};
...
@@ -2,6 +2,7 @@ use std::fmt::{Debug, Formatter};
use
std
::
ops
::{
Add
,
AddAssign
,
Sub
,
SubAssign
};
use
std
::
ops
::{
Add
,
AddAssign
,
Sub
,
SubAssign
};
use
std
::
time
::{
Duration
,
Instant
};
use
std
::
time
::{
Duration
,
Instant
};
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Copy,
Clone,
PartialEq,
PartialOrd)]
#[derive(Copy,
Clone,
PartialEq,
PartialOrd)]
pub
struct
Spot
{
pub
struct
Spot
{
inner
:
Instant
,
inner
:
Instant
,
...
@@ -39,7 +40,7 @@ impl Spot {
...
@@ -39,7 +40,7 @@ impl Spot {
/// Returns the amount of time elapsed from another instant to this one,
/// Returns the amount of time elapsed from another instant to this one,
/// or zero duration if that instant is later than this one.
/// or zero duration if that instant is later than this one.
pub
fn
saturating_duration_since
(
&
self
,
earlier
:
Spot
)
->
Duration
{
pub
fn
saturating_duration_since
(
&
self
,
earlier
:
Spot
)
->
Duration
{
self
.inner
.saturating_duration_since
(
earlier
.inner
)
.unwrap_or_default
()
self
.inner
.saturating_duration_since
(
earlier
.inner
)
}
}
/// Returns `Some(t)` where `t` is the time `self + duration` if `t` can be represented as
/// Returns `Some(t)` where `t` is the time `self + duration` if `t` can be represented as
/// `Instant` (which means it's inside the bounds of the underlying data structure), `None`
/// `Instant` (which means it's inside the bounds of the underlying data structure), `None`
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
1
−
1
View file @
eccb3d31
#[cfg(not(target_family
=
"wasm"
))]
#[cfg(not(target_family
=
"wasm"
))]
mod
instant_desktop
;
mod
instant_desktop
;
//
#[cfg(target_family = "wasm")]
#[cfg(target_family
=
"wasm"
)]
mod
instant_web
;
mod
instant_web
;
#[cfg(not(target_arch
=
"wasm32"
))]
#[cfg(not(target_arch
=
"wasm32"
))]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment