Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime 的 set_nano 方法在 add 时是否应该是调用 Duration::from_nanos #6

Open
yangbajing opened this issue May 29, 2024 · 0 comments

Comments

@yangbajing
Copy link

https://github.com/rbatis/fastdate/blob/main/src/datetime.rs#L546-L553

    pub fn set_nano(mut self, nano: u32) -> Self {
        let v = self.nano();
        if nano != v {
            self = self.sub(Duration::from_nanos(v as u64));
            self = self.add(Duration::from_micros(nano as u64));
        }
        self
    }

这里在做 add 时是否应该是 self = self.add(Duration::from_nanos(nano as u64));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant