Skip to content

Commit 3afeb1e

Browse files
committed
deploy: f0e8d44
1 parent e44f7ec commit 3afeb1e

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

dev/src/uu_date/date.rs.html

+25-11
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,13 @@
440440
<a href="#440" id="440">440</a>
441441
<a href="#441" id="441">441</a>
442442
<a href="#442" id="442">442</a>
443+
<a href="#443" id="443">443</a>
444+
<a href="#444" id="444">444</a>
445+
<a href="#445" id="445">445</a>
446+
<a href="#446" id="446">446</a>
447+
<a href="#447" id="447">447</a>
448+
<a href="#448" id="448">448</a>
449+
<a href="#449" id="449">449</a>
443450
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
444451
//
445452
// (c) Anthony Deschamps &lt;anthony.j.deschamps@gmail.com&gt;
@@ -464,7 +471,7 @@
464471
<span class="attr">#[cfg(not(any(target_os = <span class="string">&quot;macos&quot;</span>, target_os = <span class="string">&quot;redox&quot;</span>)))]
465472
</span><span class="kw">use </span>uucore::error::FromIo;
466473
<span class="kw">use </span>uucore::error::{UResult, USimpleError};
467-
<span class="kw">use </span>uucore::{format_usage, help_about, help_usage, show_error};
474+
<span class="kw">use </span>uucore::{format_usage, help_about, help_usage, show};
468475
<span class="attr">#[cfg(windows)]
469476
</span><span class="kw">use </span>windows_sys::Win32::{Foundation::SYSTEMTIME, System::SystemInformation::SetSystemTime};
470477

@@ -645,9 +652,6 @@
645652

646653
<span class="kw">return </span>set_system_datetime(date);
647654
} <span class="kw">else </span>{
648-
<span class="comment">// Declare a file here because it needs to outlive the `dates` iterator.
649-
</span><span class="kw">let </span>file: File;
650-
651655
<span class="comment">// Get the current time, either in the local time zone or UTC.
652656
</span><span class="kw">let </span>now: DateTime&lt;FixedOffset&gt; = <span class="kw">if </span>settings.utc {
653657
<span class="kw">let </span>now = Utc::now();
@@ -664,12 +668,19 @@
664668
<span class="kw">let </span>iter = std::iter::once(date);
665669
Box::new(iter)
666670
}
667-
DateSource::File(<span class="kw-2">ref </span>path) =&gt; {
668-
file = File::open(path).unwrap();
669-
<span class="kw">let </span>lines = BufReader::new(file).lines();
670-
<span class="kw">let </span>iter = lines.filter_map(Result::ok).map(parse_date);
671-
Box::new(iter)
672-
}
671+
DateSource::File(<span class="kw-2">ref </span>path) =&gt; <span class="kw">match </span>File::open(path) {
672+
<span class="prelude-val">Ok</span>(file) =&gt; {
673+
<span class="kw">let </span>lines = BufReader::new(file).lines();
674+
<span class="kw">let </span>iter = lines.filter_map(Result::ok).map(parse_date);
675+
Box::new(iter)
676+
}
677+
<span class="prelude-val">Err</span>(_err) =&gt; {
678+
<span class="kw">return </span><span class="prelude-val">Err</span>(USimpleError::new(
679+
<span class="number">2</span>,
680+
<span class="macro">format!</span>(<span class="string">&quot;{}: No such file or directory&quot;</span>, path.display()),
681+
));
682+
}
683+
},
673684
DateSource::Now =&gt; {
674685
<span class="kw">let </span>iter = std::iter::once(<span class="prelude-val">Ok</span>(now));
675686
Box::new(iter)
@@ -699,7 +710,10 @@
699710
.replace(<span class="string">&quot;%f&quot;</span>, <span class="string">&quot;%N&quot;</span>);
700711
<span class="macro">println!</span>(<span class="string">&quot;{formatted}&quot;</span>);
701712
}
702-
<span class="prelude-val">Err</span>((input, _err)) =&gt; <span class="macro">show_error!</span>(<span class="string">&quot;invalid date {}&quot;</span>, input.quote()),
713+
<span class="prelude-val">Err</span>((input, _err)) =&gt; <span class="macro">show!</span>(USimpleError::new(
714+
<span class="number">1</span>,
715+
<span class="macro">format!</span>(<span class="string">&quot;invalid date {}&quot;</span>, input.quote())
716+
)),
703717
}
704718
}
705719
}

dev/uu_date/fn.uu_app.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `uu_app` fn in crate `uu_date`."><meta name="keywords" content="rust, rustlang, rust-lang, uu_app"><title>uu_app in uu_date - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-93196c7a1c3542a8.css" id="mainThemeStyle"><link rel="stylesheet" id="themeStyle" href="../static.files/light-4743e13df3dfe8c4.css"><link rel="stylesheet" disabled href="../static.files/dark-0e1b889528bd466b.css"><link rel="stylesheet" disabled href="../static.files/ayu-65289d5d067c7c66.css"><script id="default-settings" ></script><script src="../static.files/storage-d43fa987303ecbbb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-3367e395607fafc1.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-13285aec31fa243e.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="logo-container" href="../uu_date/index.html"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2></h2></nav><nav class="sidebar"><a class="logo-container" href="../uu_date/index.html"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In uu_date</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-5ec35bf9ca753509.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="index.html">uu_date</a>::<wbr><a class="fn" href="#">uu_app</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/uu_date/date.rs.html#268-342">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><div class="item-decl"><pre class="rust"><code>pub fn uu_app() -&gt; Command</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="uu_date" data-themes="" data-resource-suffix="" data-rustdoc-version="1.68.0 (2c8cc3432 2023-03-06)" data-search-js="search-98d53477a794af0b.js" data-settings-js="settings-c3c521c753752a1a.js" data-settings-css="settings-08ddfdda51b8ee2e.css" ></div></body></html>
1+
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `uu_app` fn in crate `uu_date`."><meta name="keywords" content="rust, rustlang, rust-lang, uu_app"><title>uu_app in uu_date - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-93196c7a1c3542a8.css" id="mainThemeStyle"><link rel="stylesheet" id="themeStyle" href="../static.files/light-4743e13df3dfe8c4.css"><link rel="stylesheet" disabled href="../static.files/dark-0e1b889528bd466b.css"><link rel="stylesheet" disabled href="../static.files/ayu-65289d5d067c7c66.css"><script id="default-settings" ></script><script src="../static.files/storage-d43fa987303ecbbb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-3367e395607fafc1.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-13285aec31fa243e.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="logo-container" href="../uu_date/index.html"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2></h2></nav><nav class="sidebar"><a class="logo-container" href="../uu_date/index.html"><img class="rust-logo" src="../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In uu_date</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-5ec35bf9ca753509.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="index.html">uu_date</a>::<wbr><a class="fn" href="#">uu_app</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../src/uu_date/date.rs.html#275-349">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><div class="item-decl"><pre class="rust"><code>pub fn uu_app() -&gt; Command</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="uu_date" data-themes="" data-resource-suffix="" data-rustdoc-version="1.68.0 (2c8cc3432 2023-03-06)" data-search-js="search-98d53477a794af0b.js" data-settings-js="settings-c3c521c753752a1a.js" data-settings-css="settings-08ddfdda51b8ee2e.css" ></div></body></html>

0 commit comments

Comments
 (0)