This commit is contained in:
sylvestre
2023-02-27 02:54:32 +00:00
parent da189f1706
commit 95c7acb548
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -549,7 +549,7 @@
<span class="kw">fn </span>new(root: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>Path, target: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a </span>Path) -&gt; std::io::Result&lt;<span class="self">Self</span>&gt; {
<span class="kw">let </span>current_dir = env::current_dir()<span class="question-mark">?</span>;
<span class="kw">let </span>root_path = current_dir.join(root);
<span class="kw">let </span>root_parent = <span class="kw">if </span>target.exists() {
<span class="kw">let </span>root_parent = <span class="kw">if </span>target.exists() &amp;&amp; !root.to_str().unwrap().ends_with(<span class="string">&quot;/.&quot;</span>) {
root_path.parent().map(|p| p.to_path_buf())
} <span class="kw">else </span>{
<span class="prelude-val">Some</span>(root_path)
+2 -2
View File
@@ -304,8 +304,8 @@
USER_PROCESS =&gt; nusers += <span class="number">1</span>,
BOOT_TIME =&gt; {
<span class="kw">let </span>dt = line.login_time();
<span class="kw">if </span>dt.second() &gt; <span class="number">0 </span>{
boot_time = <span class="prelude-val">Some</span>(dt.second() <span class="kw">as </span>time_t);
<span class="kw">if </span>dt.unix_timestamp() &gt; <span class="number">0 </span>{
boot_time = <span class="prelude-val">Some</span>(dt.unix_timestamp() <span class="kw">as </span>time_t);
}
}
<span class="kw">_ </span>=&gt; <span class="kw">continue</span>,