summaryrefslogtreecommitdiff
path: root/src/utils.cpp
diff options
context:
space:
mode:
authorGravatar Alexander Batischev <eual.jp@gmail.com> 2019-09-28 21:46:03 +0300
committerGravatar Alexander Batischev <eual.jp@gmail.com> 2019-09-28 23:17:58 +0300
commit1e08618a01d0521d1972de0a8cb1a100c857e660 (patch)
tree17a1a9b4e4ad6b43445862c0e275fc6d2204b6cd /src/utils.cpp
parentc63da29f70de21f045a1e40d45bcbf332ef71a4c (diff)
downloadnewsboat-1e08618a01d0521d1972de0a8cb1a100c857e660.tar.gz
newsboat-1e08618a01d0521d1972de0a8cb1a100c857e660.tar.zst
newsboat-1e08618a01d0521d1972de0a8cb1a100c857e660.zip
Port utils::strip_comments to Rust
Diffstat (limited to 'src/utils.cpp')
-rw-r--r--src/utils.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/utils.cpp b/src/utils.cpp
index d7351425..9b50a492 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -78,14 +78,7 @@ void append_escapes(std::string& str, char c)
std::string utils::strip_comments(const std::string& line)
{
- /*
- * This functions returns only the non-comment part of the line,
- * which can then be safely evaluated and tokenized.
- *
- * If no comments are present on the line, the whole line is returned.
- */
- auto hash_pos = line.find_first_of("#");
- return line.substr(0, hash_pos);
+ return RustString(rs_strip_comments(line.c_str()));
}
std::vector<std::string> utils::tokenize_quoted(const std::string& str,